summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2010-01-11 17:04:44 +0000
committererdgeist <erdgeist@erdgeist.org>2010-01-11 17:04:44 +0000
commit9eeb4ed216b0eede48eadb03dc8d84de597652e2 (patch)
tree7e9eca12ffbd41187d6ca15575308d958a0d7300
parentcbba8dd3f93424b47e287686471f441e9753e9aa (diff)
Remove bashism, use freebsd-updates way to wait randomly. Thanks to Panagiotis J. Christias
-rwxr-xr-xezjail-admin8
1 files changed, 3 insertions, 5 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 1e8207b..599c82c 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -793,11 +793,9 @@ setup|update)
793 [ -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." 793 [ -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."
794 794
795 # If ran from cron be kind to freebsds update servers and sleep first 795 # If ran from cron be kind to freebsds update servers and sleep first
796 [ -z "$TERM" -o "$TERM" = "dumb" ] && sleep $(( ${RANDOM} % 3600 )) 796 [ -z "$TERM" -o "$TERM" = "dumb" ] && ezjail_urgency="cron" || ezjail_urgency="fetch"
797 if [ "${ezjail_use_zfs}" = "YES" ]; then 797 [ "${ezjail_use_zfs}" = "YES" ] && zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"`
798 zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` 798 freebsd-update -b ${ezjail_jailbase} ${ezjail_urgency} install
799 fi
800 freebsd-update -b ${ezjail_jailbase} fetch install
801 else 799 else
802 # Bump the user for some of the most common errors 800 # Bump the user for some of the most common errors
803 [ -d "${ezjail_sourcetree}" ] || exerr "Error: Cannot find your copy of the FreeBSD source tree in ${ezjail_sourcetree}.\n Consider using '${ezjail_admin} install' to create the base jail from an ftp server." 801 [ -d "${ezjail_sourcetree}" ] || exerr "Error: Cannot find your copy of the FreeBSD source tree in ${ezjail_sourcetree}.\n Consider using '${ezjail_admin} install' to create the base jail from an ftp server."