🚧 added fetch, persist width
This commit is contained in:
@@ -87,6 +87,7 @@ $pconfig['enforce_statfs'] = exec("/usr/bin/grep '.*enforce_statfs.*=' $jail_con
|
||||
$pconfig['osrelease'] = exec("/usr/local/bin/bastille config {$item} get osrelease | cut -d '=' -f2 | tr -d ' ;'");
|
||||
$pconfig['vnet_interface'] = exec("/usr/bin/grep '.*vnet.interface.*=' $jail_config | cut -d '=' -f2 | tr -d ' ;'");
|
||||
$pconfig['boot_prio'] = exec("/usr/local/bin/bastille config {$item} get priority");
|
||||
$pconfig['description'] = exec("/usr/local/bin/bastille config {$item} get description");
|
||||
|
||||
// Set the jail config default parameters.
|
||||
$jail_name_def = $pconfig['jname'];
|
||||
@@ -100,6 +101,7 @@ $jail_enforce_statfs_def = $pconfig['enforce_statfs'];
|
||||
$jail_osrelease_def = $pconfig['osrelease'];
|
||||
$jail_vnet_interface_def = $pconfig['vnet_interface'];
|
||||
$jail_boot_prio_def = $pconfig['boot_prio'];
|
||||
$jail_description_def = $pconfig['description'];
|
||||
|
||||
// Check if is a Linux jail.
|
||||
$is_linux_jail = exec("/usr/bin/grep linsysfs {$jail_dir}/{$jail_name_def}/fstab");
|
||||
@@ -233,6 +235,9 @@ if ($_POST):
|
||||
if(isset($pconfig['boot_prio'])):
|
||||
$jail_boot_prio = $pconfig['boot_prio'];
|
||||
endif;
|
||||
if(isset($pconfig['description'])):
|
||||
$jail_description = $pconfig['description'];
|
||||
endif;
|
||||
|
||||
// Check if the config has changed for each parameters.
|
||||
// This jails wide changes requires the jail to be already stopped.
|
||||
@@ -434,6 +439,18 @@ if ($_POST):
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (isset($_POST['description']) || $_POST['description']):
|
||||
if($jail_description_def !== $jail_description):
|
||||
$cmd = "/usr/local/bin/bastille config {$item} set description \"$jail_description\"";
|
||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||
if($retval == 0):
|
||||
//$savemsg .= gtext("Description changed successfully.");
|
||||
else:
|
||||
$input_errors[] = gtext("Failed to save description.");
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (isset($_POST['jname']) && $_POST['jname']):
|
||||
if($jail_name_def !== $jail_name):
|
||||
$cmd = "/usr/local/bin/bastille rename $jail_name_def $jail_name";
|
||||
@@ -498,6 +515,7 @@ endif;
|
||||
html_titleline2(gtext("Misc Configuration"));
|
||||
html_checkbox2('autostart',gtext('Autoboot'),!empty($pconfig['autostart']) ? true : false,gtext('Autoboot this jail after system reboot.'),'',false);
|
||||
html_inputbox("boot_prio", gtext("Priority"), $pconfig['boot_prio'], gtext("Set the priority value of the jail. Affects the boot order behaviour."), false, 20);
|
||||
html_inputbox("description", gtext("Description"), $pconfig['description'], gtext("Set a description for the jail."), false, 40);
|
||||
//html_checkbox2('force_edit',gtext('Force edit'),!empty($pconfig['force_edit']) ? true : false,gtext('Automatically stop and start this jail if is already running.'),'',false);
|
||||
?>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user