Skip to content

Commit b3b73da

Browse files
committed
Prevent empty exec
1 parent 834f777 commit b3b73da

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nodeapp.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function hcpp_runuser( $cmd ) {
4040
/**
4141
* Check if system has rebooted and restart apps
4242
*/
43-
public function hcpp_rebooted( $args ) {
43+
public function hcpp_rebooted() {
4444

4545
// Restart all PM2 apps for all user accounts
4646
$users = scandir('/home');
@@ -60,7 +60,10 @@ public function hcpp_rebooted( $args ) {
6060
$cmd .= 'export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && pm2 resurrect"' . "\n";
6161
}
6262
}
63-
shell_exec( $hcpp->do_action( 'nodeapp_resurrect_apps', $cmd ) );
63+
$cmd = $hcpp->do_action( 'nodeapp_resurrect_apps', $cmd );
64+
if ( trim( $cmd ) != '' ) {
65+
$hcpp->log( shell_exec( $cmd ) );
66+
}
6467
}
6568

6669
/**

0 commit comments

Comments
 (0)