Skip to content

Commit

Permalink
update: show installed version with -vk' or -vb'
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jul 2, 2017
1 parent 3378068 commit 43d09d1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions update/opnsense-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ DO_INSECURE=
DO_RELEASE=
DO_FLAVOUR=
DO_UPGRADE=
DO_VERSION=
DO_KERNEL=
DO_LOCAL=
DO_FORCE=
Expand Down Expand Up @@ -191,8 +192,7 @@ while getopts a:Bbcdefhikl:Mm:N:n:Ppr:st:uv OPT; do
DO_UPGRADE="-u"
;;
v)
echo ${VERSION}-${ARCH}
exit 0
DO_VERSION="-v"
;;
*)
echo "Usage: man opnsense-update" >&2
Expand All @@ -203,6 +203,17 @@ done

shift $((${OPTIND} - 1))

if [ -n "${DO_VERSION}" ]; then
if [ -n "${DO_BASE}" ]; then
echo ${INSTALLED_BASE}
elif [ -n "${DO_KERNEL}" ]; then
echo ${INSTALLED_KERNEL}
else
echo ${VERSION}-${ARCH}
fi
exit 0
fi

if [ -n "${DO_TYPE}" ]; then
OLD=$(cat /usr/local/opnsense/version/opnsense.name)
NEW=${DO_TYPE#"-t "}
Expand Down

0 comments on commit 43d09d1

Please sign in to comment.