mirror of
https://github.com/JRGTH/xigmanas-bastille-extension.git
synced 2025-12-11 17:31:09 +01:00
Use sysrc to manage jail startup variables
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
======================
|
||||
Version Description
|
||||
|
||||
1.0.74......Use sysrc to manage jail startup variables.
|
||||
1.0.73......Fix typo and minor changes.
|
||||
1.0.72......Add jail cloning ability to WebGUI utilities and minor changes.
|
||||
1.0.71......Enable all options by default.
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -241,7 +241,7 @@ if($_POST):
|
||||
$container['jailname'] = $_POST['jailname'];
|
||||
$confirm_name = $pconfig['confirmname'];
|
||||
$item = $container['jailname'];
|
||||
$cmd = ("/usr/sbin/sysrc -f {$configfile} {$item}_AUTO_START=\"NO\"");
|
||||
$cmd = ("/usr/sbin/sysrc -f {$configfile} -x {$item}_AUTO_START");
|
||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||
if($retval == 0):
|
||||
header('Location: bastille_manager_gui.php');
|
||||
|
||||
Reference in New Issue
Block a user