Skip to content

Commit 5ecd14d

Browse files
committed
Consolident function req. to just shell_exec
1 parent 576bd48 commit 5ecd14d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

webdav.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,14 @@ public function stop() {
132132

133133
// Find all rclone webdav processes for the /home folder
134134
$cmd = 'ps ax | grep "rclone serve webdav" | grep "/home" | grep -v grep';
135-
exec($cmd, $processes);
135+
$processes = explode( PHP_EOL, shell_exec( $cmd ) );
136136

137137
// Loop through each process and extract the process ID (PID)
138138
foreach ($processes as $process) {
139139
$pid = preg_replace('/^\s*(\d+).*$/', '$1', $process);
140140

141141
// Kill the process
142-
$kill = "kill $pid";
143-
exec($kill, $output, $returnValue);
142+
shell_exec( "kill $pid" );
144143

145144
global $hcpp;
146145
$hcpp->log( "Killed rclone webdav process $pid" );

0 commit comments

Comments
 (0)