summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin13
1 files changed, 8 insertions, 5 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 3a6c5a4..4fac8cf 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -31,6 +31,7 @@ ezjail_snap_date_format="%Y%m%d%H%M"
31: ${ezjail_procfs_enable="YES"} 31: ${ezjail_procfs_enable="YES"}
32: ${ezjail_fdescfs_enable="YES"} 32: ${ezjail_fdescfs_enable="YES"}
33: ${ezjail_exec_start="/bin/sh /etc/rc"} 33: ${ezjail_exec_start="/bin/sh /etc/rc"}
34: ${ezjail_exec_stop="/bin/sh /etc/rc.shutdown"}
34 35
35: ${ezjail_use_zfs="NO"} 36: ${ezjail_use_zfs="NO"}
36 37
@@ -335,7 +336,7 @@ ezjail_queryftpserver () {
335 unset _ret 336 unset _ret
336 echo -n "Querying your ftp-server... " 337 echo -n "Querying your ftp-server... "
337 TIFS=${IFS}; IFS= 338 TIFS=${IFS}; IFS=
338 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots pub/FreeBSD-Archive/old-releases NO; do 339 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshots pub/FreeBSD releases snapshots pub/FreeBSD-Archive/old-releases NO; do
339 if [ ${ezjail_path} = "NO" ]; then 340 if [ ${ezjail_path} = "NO" ]; then
340 echo "Warning: I am having problems querying the ftp server you specified (${ezjail_disturi})." 341 echo "Warning: I am having problems querying the ftp server you specified (${ezjail_disturi})."
341 _ret=1; break 342 _ret=1; break
@@ -463,7 +464,7 @@ filteroldsnapshots() {
463 case ${win} in [0-9]);; [0-9]*[0-9mhdwy]);; *) echo "Unknown window length declaration ${win}"; return ;; esac 464 case ${win} in [0-9]);; [0-9]*[0-9mhdwy]);; *) echo "Unknown window length declaration ${win}"; return ;; esac
464 465
465 # values default to minutes 466 # values default to minutes
466 case ${win} in *h) m=60;; *d) m=1440;; *w) m=10080;; *y) m=*525600;; *) m=1;; esac 467 case ${win} in *h) m=60;; *d) m=1440;; *w) m=10080;; *y) m=525600;; *) m=1;; esac
467 win=$((${win%[mhdwy]}*m*60)) 468 win=$((${win%[mhdwy]}*m*60))
468 469
469 # innerloop $repeats over windows 470 # innerloop $repeats over windows
@@ -1008,8 +1009,10 @@ setup|update)
1008 zfs snapshot ${ezjail_jailzfs}/basejail@`date +"%C%y%m%d_%H:%M:%S"` 1009 zfs snapshot ${ezjail_jailzfs}/basejail@`date +"%C%y%m%d_%H:%M:%S"`
1009 zfs snapshot ${ezjail_jailzfs}/newjail@`date +"%C%y%m%d_%H:%M:%S"` 1010 zfs snapshot ${ezjail_jailzfs}/newjail@`date +"%C%y%m%d_%H:%M:%S"`
1010 fi 1011 fi
1011 env PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} ${ezjail_urgency} install 1012
1012 env PAGER=/bin/cat freebsd-update -b ${ezjail_jailtemplate} ${ezjail_urgency} install 1013 UNAME_r=$( "${ezjail_jailbase}"/bin/freebsd-version -u )
1014 env PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} --currently-running ${UNAME_r} ${ezjail_urgency} install
1015 env PAGER=/bin/cat freebsd-update -b ${ezjail_jailtemplate} ${ezjail_urgency} --currently-running ${UNAME_r} install
1013 elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then 1016 elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then
1014 [ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first." 1017 [ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first."
1015 1018
@@ -1053,7 +1056,7 @@ setup|update)
1053 1056
1054 # make and setup our world, then split basejail and newjail 1057 # make and setup our world, then split basejail and newjail
1055 cd "${ezjail_sourcetree}" && env DESTDIR="${ezjail_jailfull}" make ${ezjail_installaction} || exerr "Error: The command 'make ${ezjail_installaction}' failed.\n Refer to the error report(s) above." 1058 cd "${ezjail_sourcetree}" && env DESTDIR="${ezjail_jailfull}" make ${ezjail_installaction} || exerr "Error: The command 'make ${ezjail_installaction}' failed.\n Refer to the error report(s) above."
1056 cd "${ezjail_sourcetree}/etc" && env DESTDIR="${ezjail_jailfull}" make distribution || exerr "Error: The command 'make distribution' failed.\n Refer to the error report(s) above." 1059 cd "${ezjail_sourcetree}" && env DESTDIR="${ezjail_jailfull}" make distribution || exerr "Error: The command 'make distribution' failed.\n Refer to the error report(s) above."
1057 ezjail_splitworld 1060 ezjail_splitworld
1058 1061
1059 fi # installaction="none" 1062 fi # installaction="none"