Remove bashism, use freebsd-updates way to wait randomly. Thanks to Panagiotis J. Christias

This commit is contained in:
erdgeist 2010-01-11 17:04:44 +00:00
parent cbba8dd3f9
commit 9eeb4ed216

View File

@ -793,11 +793,9 @@ setup|update)
[ -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." [ -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."
# If ran from cron be kind to freebsds update servers and sleep first # If ran from cron be kind to freebsds update servers and sleep first
[ -z "$TERM" -o "$TERM" = "dumb" ] && sleep $(( ${RANDOM} % 3600 )) [ -z "$TERM" -o "$TERM" = "dumb" ] && ezjail_urgency="cron" || ezjail_urgency="fetch"
if [ "${ezjail_use_zfs}" = "YES" ]; then [ "${ezjail_use_zfs}" = "YES" ] && zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"`
zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` freebsd-update -b ${ezjail_jailbase} ${ezjail_urgency} install
fi
freebsd-update -b ${ezjail_jailbase} fetch install
else else
# Bump the user for some of the most common errors # Bump the user for some of the most common errors
[ -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." [ -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."