1
0
Fork 0
forked from mirrors/openup

Fix error outputs.

This commit is contained in:
Antoine Jacoutot 2013-08-12 14:55:27 +02:00
commit 451145168b

14
openup
View file

@ -37,7 +37,7 @@ usage() {
}
if [ "$(id -u)" -ne 0 ]; then
error "need root privileges to run this script"
echo "need root privileges to run this script"
usage
fi
@ -45,15 +45,11 @@ fi
set -A REL -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
REL_INT="$(echo ${REL[0]} | tr -d '.')"
if [ "${REL[1]}" == -!(stable) ]; then
error "XXX -current is a no-no"
if [ "${REL[1]}" == -!(stable) -o "${REL_INT}" -lt "${OPENUP_MINREL}"]; then
echo "!!! ${REL[0]}${REL[1]} is not a supported release"
exit 1
fi
if [ "${REL_INT}" -lt "${OPENUP_MINREL}" ]; then
error "XXX release ${REL[0]} is a no-no (non-fatal)"
fi
OPENUP_VERSION=2
OPENUP_MINREL=53
MEESA=$(readlink -f $0)
@ -64,10 +60,6 @@ TMPSPLITCERT=$(mktemp -p ${TMPDIR} openup-split_cert.XXXXXX) || exit 1
trap "rm -f ${TMPDIR}/openup-*" 1 2 3 13 15
error() {
echo -n "*** ERROR: $@"
}
print3() {
echo "===> ${@}${DRYRUN}"
}