Use sysrc to manage jail startup variables
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
======================
|
======================
|
||||||
Version Description
|
Version Description
|
||||||
|
|
||||||
|
1.0.74......Use sysrc to manage jail startup variables.
|
||||||
1.0.73......Fix typo and minor changes.
|
1.0.73......Fix typo and minor changes.
|
||||||
1.0.72......Add jail cloning ability to WebGUI utilities and minor changes.
|
1.0.72......Add jail cloning ability to WebGUI utilities and minor changes.
|
||||||
1.0.71......Enable all options by default.
|
1.0.71......Enable all options by default.
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ if ($_POST):
|
|||||||
if (isset($_POST['autostart']) && $_POST['autostart']):
|
if (isset($_POST['autostart']) && $_POST['autostart']):
|
||||||
if($jail_name_def !== $jail_name):
|
if($jail_name_def !== $jail_name):
|
||||||
// Remove obsolete variable.
|
// 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;
|
endif;
|
||||||
$cmd = ("/usr/sbin/sysrc -f $configfile {$jail_name}_AUTO_START=\"YES\"");
|
$cmd = ("/usr/sbin/sysrc -f $configfile {$jail_name}_AUTO_START=\"YES\"");
|
||||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||||
@@ -316,9 +316,9 @@ if ($_POST):
|
|||||||
else:
|
else:
|
||||||
if($jail_name_def !== $jail_name):
|
if($jail_name_def !== $jail_name):
|
||||||
// Remove obsolete variable.
|
// 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;
|
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);
|
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||||
if($retval == 0):
|
if($retval == 0):
|
||||||
//$savemsg .= gtext("Autostart changed successfully.");
|
//$savemsg .= gtext("Autostart changed successfully.");
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ if($_POST):
|
|||||||
$container['jailname'] = $_POST['jailname'];
|
$container['jailname'] = $_POST['jailname'];
|
||||||
$confirm_name = $pconfig['confirmname'];
|
$confirm_name = $pconfig['confirmname'];
|
||||||
$item = $container['jailname'];
|
$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);
|
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||||
if($retval == 0):
|
if($retval == 0):
|
||||||
header('Location: bastille_manager_gui.php');
|
header('Location: bastille_manager_gui.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user