Add ability to enable ZFS easily

This commit is contained in:
Jose
2019-11-22 06:29:34 -04:00
parent 25f55af3ec
commit 13f1739f96
6 changed files with 119 additions and 5 deletions
+15
View File
@@ -58,6 +58,7 @@ $jail_dir = "{$rootfolder}/jails";
$image_dir = "ext/bastille/images";
$thick_jail = exec("/usr/local/bin/bastille create | grep -wo '\[option\]'");
$reldir = "{$rootfolder}/releases";
$zfs_support = exec("/bin/cat {$configfile} | /usr/bin/grep 'ZFS_SUPPORT=' | /usr/bin/cut -d'\"' -f2");
// Ensure the root directory is configured.
if ($rootfolder == "")
@@ -77,6 +78,20 @@ function is_dir_empty($reldir) {
return (count(scandir($reldir)) == 2);
}
// Check for sane ZFS settings.
function get_state_zfs() {
global $zfs_support;
if ($zfs_support == "YES"):
return $getinfo['zfs'] = gettext("Enabled");
elseif ($zfs_support == "AVA"):
return $getinfo['zfs'] = gettext("Available but not enabled");
elseif ($zfs_support == "ERR"):
return $getinfo['zfs'] = gettext("Invalid ZFS configuration");
else:
return $getinfo['zfs'] = gettext("Disabled");
endif;
}
// Get all base releases list.
function get_all_release_list() {
global $rootfolder;