mirror of
https://github.com/JRGTH/xigmanas-bastille-extension.git
synced 2025-12-12 09:49:56 +01:00
Use sysrc to manage jail startup variables
This commit is contained in:
@@ -304,7 +304,7 @@ if ($_POST):
|
||||
if (isset($_POST['autostart']) && $_POST['autostart']):
|
||||
if($jail_name_def !== $jail_name):
|
||||
// Remove obsolete variable.
|
||||
exec("/usr/bin/sed -i '' 's/{$jail_name_def}_AUTO_START.*//' $configfile");
|
||||
exec("/usr/sbin/sysrc -f $configfile -x {$jail_name_def}_AUTO_START");
|
||||
endif;
|
||||
$cmd = ("/usr/sbin/sysrc -f $configfile {$jail_name}_AUTO_START=\"YES\"");
|
||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||
@@ -316,9 +316,9 @@ if ($_POST):
|
||||
else:
|
||||
if($jail_name_def !== $jail_name):
|
||||
// Remove obsolete variable.
|
||||
exec("/usr/bin/sed -i '' 's/{$jail_name_def}_AUTO_START.*//' $configfile");
|
||||
exec("/usr/sbin/sysrc -f $configfile -x {$jail_name_def}_AUTO_START");
|
||||
endif;
|
||||
$cmd = ("/usr/bin/sed -i '' 's/{$jail_name}_AUTO_START.*//' $configfile");
|
||||
$cmd = ("/usr/sbin/sysrc -f $configfile -x {$jail_name}_AUTO_START");
|
||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||
if($retval == 0):
|
||||
//$savemsg .= gtext("Autostart changed successfully.");
|
||||
|
||||
Reference in New Issue
Block a user