diff --git a/CHANGELOG b/CHANGELOG index 98ff5a4..2c35501 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.69......Fix for jail auto-start settings with names containing dashes. 1.0.68......Remove the -q option in utilities page. 1.0.67......Fix for properly identify the jail type, thanks to mvdhoeven. 1.0.66......Update extension and bastille config files at once. diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index b5afb73..0ad1023 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -229,7 +229,7 @@ function get_jail_infos() { $r['path'] = "-"; endif; // Display auto-start settings. - $jail_autostart = exec("/usr/sbin/sysrc -qn -f {$configfile} {$item}_AUTO_START"); + $jail_autostart = exec("/usr/bin/grep -w {$item}_AUTO_START $configfile | cut -d'=' -f2 | tr -d '\"'"); if ($jail_autostart == 'YES') { $r['boot'] = $img_path['ena']; } elseif ($jail_autostart == 'NO') { diff --git a/gui/bastille_manager_jconf.php b/gui/bastille_manager_jconf.php index 061d933..f15df15 100644 --- a/gui/bastille_manager_jconf.php +++ b/gui/bastille_manager_jconf.php @@ -65,7 +65,7 @@ $jail_config = "$jail_dir/$container/jail.conf"; // Get some jail system settings. $is_vnet = exec("/usr/bin/grep '.*vnet;' $jail_config"); -$pconfig['autostart'] = exec("/usr/bin/grep '{$container}_AUTO_START=\"YES\"' $bastille_config"); +$pconfig['autostart'] = exec("/usr/bin/grep -w '{$container}_AUTO_START=\"YES\"' $bastille_config"); // Get some jail config parameters. // This could be done with a nice php preg loop in the future. @@ -304,7 +304,7 @@ if ($_POST): if (isset($_POST['autostart']) && $_POST['autostart']): if($jail_name_def !== $jail_name): // Remove obsolete variable. - exec("/usr/sbin/sysrc -f $configfile -qx {$jail_name_def}_AUTO_START"); + exec("/usr/bin/sed -i '' 's/{$jail_name_def}_AUTO_START.*//' $configfile"); 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/sbin/sysrc -f $configfile -qx {$jail_name_def}_AUTO_START"); + exec("/usr/bin/sed -i '' 's/{$jail_name_def}_AUTO_START.*//' $configfile"); endif; - $cmd = ("/usr/sbin/sysrc -f {$configfile} {$jail_name}_AUTO_START=\"NO\""); + $cmd = ("/usr/bin/sed -i '' 's/{$jail_name}_AUTO_START.*//' $configfile"); unset($output,$retval);mwexec2($cmd,$output,$retval); if($retval == 0): //$savemsg .= gtext("Autostart changed successfully."); diff --git a/version b/version index 01c08cf..3116087 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.68 +1.0.69