diff --git a/CHANGELOG b/CHANGELOG index 95405e2..97db614 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.55......Add backup path config check. 1.0.54......Don't skip ZFS activation if "Available but not enabled" status displayed. 1.0.53......Add initial ZFS activation guided support. 1.0.52......Switch repository for early updates and bug fixes. diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index befea12..0d032d4 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -58,7 +58,7 @@ $jail_dir = "{$rootfolder}/jails"; $image_dir = "ext/bastille/images"; $options_support = exec("/usr/local/bin/bastille create | grep -wo '\[option\]'"); $reldir = "{$rootfolder}/releases"; -//$zfs_already = exec("/sbin/zfs list | /usr/bin/grep -w $rootfolder/bastille"); +$backup_path_bastille = exec("/usr/sbin/sysrc -f $rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf -qn bastille_backupsdir"); $zfs_support = exec("/usr/bin/grep 'ZFS_SUPPORT=' $configfile | /usr/bin/cut -d'\"' -f2"); $zfs_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $configfile | /usr/bin/cut -d'\"' -f2"); diff --git a/gui/bastille_manager_maintenance.php b/gui/bastille_manager_maintenance.php index d85fa9b..fdb22b3 100644 --- a/gui/bastille_manager_maintenance.php +++ b/gui/bastille_manager_maintenance.php @@ -73,6 +73,7 @@ $tarballversion = "/usr/local/bin/bastille"; if ($_POST) { global $zfs_activated; + global $backup_path_bastille; if(isset($_POST['upgrade']) && $_POST['upgrade']): $cmd = sprintf('%1$s/bastille-init -u > %2$s',$rootfolder,$logevent); $return_val = 0; @@ -144,6 +145,13 @@ if ($_POST) { $backup_path = "{$rootfolder}/backups"; } if (!is_file($backup_path)) { + if($backup_path_bastille !== $backup_path): + $errormsg = gtext('Selected backup path does not match with bastille_backupsdir in bastille.conf.') + . ' ' + . '' + . gtext('Please set the bastille_backupsdir in bastille.conf first.') + . ''; + else: $cmd = "/usr/sbin/sysrc -f {$configfile} BACKUP_DIR={$backup_path}"; unset($retval);mwexec($cmd,$retval); if ($retval == 0) { @@ -154,6 +162,7 @@ if ($_POST) { $input_errors[] = gtext("Failed to save extension settings."); exec("echo '{$date}: {$application}: Failed to save extension settings' >> {$logfile}"); } + endif; } else { $input_errors[] = gtext("Failed to save extension settings."); @@ -186,7 +195,9 @@ if ($_POST) { endif; else: $zfs_status = get_state_zfs(); - if($zfs_status == "Invalid ZFS configuration"): + if($zfs_status == "Available but not enabled"): + $input_errors[] = gtext("Cannot skip ZFS activation with current config, either disable ZFS option in the config or just Activate ZFS support."); + elseif($zfs_status == "Invalid ZFS configuration"): $input_errors[] = gtext("Cannot skip ZFS activation with an invalid configuration."); elseif($zfs_status == "Enabled"): exec("/usr/sbin/sysrc -f {$configfile} ZFS_ACTIVATED=\"YES\""); diff --git a/version b/version index 970b756..78a3e6e 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.54 +1.0.55