bootstrap|sign|update: fix these too

This commit is contained in:
Franco Fichtner 2017-04-27 21:36:18 +02:00
parent d2f80449b0
commit da040805b5
3 changed files with 6 additions and 3 deletions

View File

@ -70,6 +70,8 @@ while getopts fin:t:V:vy OPT; do
esac
done
shift $((${OPTIND} - 1))
if [ "$(id -u)" != "0" ]; then
echo "Must be root." >&2
exit 1

View File

@ -35,15 +35,12 @@ while getopts c:k:p: OPT; do
case ${OPT} in
c)
CERT=${OPTARG}
shift;shift
;;
k)
KEY=${OPTARG}
shift;shift
;;
p)
PREFIX=${OPTARG}
shift;shift
;;
*)
echo "Usage: opnsense-sign -p prefix file" >&2
@ -52,6 +49,8 @@ while getopts c:k:p: OPT; do
esac
done
shift $((${OPTIND} - 1))
FILE=${1}
if [ -n "${PREFIX}" ]; then

View File

@ -201,6 +201,8 @@ while getopts a:Bbcdefhikl:Mm:N:n:Ppr:st:uv OPT; do
esac
done
shift $((${OPTIND} - 1))
if [ -n "${DO_TYPE}" ]; then
OLD=$(cat /usr/local/opnsense/version/opnsense.name)
NEW=${DO_TYPE#"-t "}