summaryrefslogtreecommitdiff
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2019-10-19 13:14:24 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2019-10-19 13:14:24 +0000
commit0647a8191b1b64add344b7921a97303f1ad3c1ba (patch)
tree2329f743d5f0f5b69b18d78f7631e568e5217dca /usr.sbin/syspatch/syspatch.sh
parentb48a5b6efb6c4529dbac9c6b3a844896a3bc98ca (diff)
Determine the OS version in a way that won't break after 9.9.
Do it the same way in all three copies of the code. Based on a patch from Chris Waddey. with & ok ajacoutot
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index fd895fd8049..1ef419037b1 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.151 2019/10/14 06:56:54 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.152 2019/10/19 13:14:23 tb Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -267,7 +267,7 @@ unpriv()
# only run on release (not -current nor -stable)
set -A _KERNV -- $(sysctl -n kern.version |
- sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
+ sed 's/^OpenBSD \([1-9][0-9]*\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
((${#_KERNV[*]} > 1)) && sp_err "Unsupported release: ${_KERNV[0]}${_KERNV[1]}"
[[ $@ == @(|-[[:alpha:]]) ]] || usage; [[ $@ == @(|-(c|R|r)) ]] &&