diff --git a/CHANGELOG b/CHANGELOG index 9d66363..328a589 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.37......Add initial support for IPv6 and VNET. 1.0.36......Remove obsolete code, update config. 1.0.35......Use bastille built-in convert function. 1.0.34......Use bastille built-in export/import functions. diff --git a/bastille-init b/bastille-init index de56b99..e53aace 100755 --- a/bastille-init +++ b/bastille-init @@ -762,6 +762,9 @@ zfs_activate() jail_import() { # Foreign jail import support using rsync. + # This will attempt to import a foreign(Thebrig) jail into Bastille, + # however only basic IOcage jails are officially supported by Bastille import. + # Since importing Thebrig jails is almost unsupported/untested, this function may be deprecated at any time. USAGE="Usage: ${SCRIPTNAME} -I [path]" if [ -z "${TARGET}" ]; then @@ -821,10 +824,10 @@ jail_import() if [ -f "${TARGET}/root/.profile" ]; then if [ -d "${bastille_jailsdir}" ]; then if [ ! -d "${bastille_jailsdir}/${NAME_TRIM}" ]; then - # Create required ZFS datasets. + # Create required ZFS datasets, mountpoint should be inherited. echo "Creating required ZFS datasets..." zfs create ${bastille_zfs_options} ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME_TRIM} - zfs create ${bastille_zfs_options} -o mountpoint=${bastille_jailsdir}/${NAME_TRIM}/root ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME_TRIM}/root + zfs create ${bastille_zfs_options} ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME_TRIM}/root echo "Importing foreign jail '${NAME_TRIM}' to ${PRDNAME}..." echo "Synchronizing '${NAME_TRIM}' data to ${bastille_jailsdir}/${NAME_TRIM}..." rsync -a ${EXCLUDE} ${TARGET}/ ${bastille_jailsdir}/${NAME_TRIM}/root/ diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index 0807d62..9332e8f 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -56,7 +56,7 @@ $config_path = exec("/bin/cat {$configfile} | /usr/bin/grep 'BASTILLE_CONFIG=' | $default_distfiles = exec("/bin/cat {$config_path} | /usr/bin/grep 'bastille_bootstrap_archives=' | /usr/bin/cut -d'\"' -f2"); $jail_dir = "{$rootfolder}/jails"; $image_dir = "ext/bastille/images"; -$thick_jail = exec("/usr/local/bin/bastille create | grep -wo '\[option\]'"); +$options_support = 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"); @@ -174,6 +174,9 @@ function get_jail_infos() { // Set the IPv4 on the running jails. //$r['ip'] = exec("/usr/sbin/jls | /usr/bin/grep {$item} | /usr/bin/awk '{print $2}'"); $r['ip'] = exec("/usr/bin/grep -w 'ip4.addr' {$jail_dir}/{$item}/jail.conf | /usr/bin/awk '{print $3}' | /usr/bin/tr -d ';'"); + if (!$r['ip']): + $r['ip'] = exec("/usr/bin/grep -w 'ip6.addr' {$jail_dir}/{$item}/jail.conf | /usr/bin/awk '{print $3}' | /usr/bin/tr -d ';'"); + endif; if (!$r['ip']): $r['ip'] = "-"; endif; diff --git a/gui/bastille_manager_add.php b/gui/bastille_manager_add.php index ec8761a..c4edf48 100644 --- a/gui/bastille_manager_add.php +++ b/gui/bastille_manager_add.php @@ -81,10 +81,16 @@ if($_POST): $thick_jail = ""; endif; - if ($_POST['nowstart']): - $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$jname} {$release} {$ipaddr} {$interface} && /usr/local/bin/bastille start {$jname}"); + if($_POST['vnetjail']): + $vnet_jail = "-V"; else: - $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$jname} {$release} {$ipaddr} {$interface}"); + $vnet_jail = ""; + endif; + + if ($_POST['nowstart']): + $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$vnet_jail} {$jname} {$release} {$ipaddr} {$interface} && /usr/local/bin/bastille start {$jname}"); + else: + $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$vnet_jail} {$jname} {$release} {$ipaddr} {$interface}"); endif; if ($_POST['Create']): @@ -156,13 +162,14 @@ $document->render(); render(); + - @@ -257,7 +257,7 @@ $document->render(); - + diff --git a/gui/bastille_manager_maintenance.php b/gui/bastille_manager_maintenance.php index 830d5ad..ceed1ad 100644 --- a/gui/bastille_manager_maintenance.php +++ b/gui/bastille_manager_maintenance.php @@ -164,7 +164,7 @@ if ($_POST) { else: if (is_file($backup_file)) { $cmd = ("/usr/local/bin/bastille import '{$filename_trim}'"); - unset($retval);mwexec($cmd,$retval); + unset($output,$retval);mwexec2($cmd,$output,$retval); if ($retval == 0) { $savemsg .= gtext("Container restored successfully."); exec("echo '{$date}: {$application}: Container restored successfully from {$filename_trim}' >> {$logfile}"); diff --git a/gui/bastille_manager_util.php b/gui/bastille_manager_util.php index 004ba7e..7f53810 100644 --- a/gui/bastille_manager_util.php +++ b/gui/bastille_manager_util.php @@ -296,7 +296,7 @@ if($_POST): break; else: if ($_POST['nowstop']): - $cmd = ("/usr/local/bin/bastille stop {$item} && /usr/local/bin/bastille destroy {$item}"); + $cmd = ("/usr/local/bin/bastille destroy -f {$item}"); else: $cmd = ("/usr/local/bin/bastille destroy {$item}"); endif; diff --git a/version b/version index 2e9116b..f6c5328 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.36 +1.0.37