scripts/installer.sh: use expr for regex matches.

=~ doesn't work in posix shell, only in bash, and we don't use bash.

Signed-off-by: David Anderson <danderson@tailscale.com>
pull/3150/head
David Anderson 3 years ago committed by Dave Anderson
parent 7ce9c7ce84
commit 1b4e007425

@ -38,7 +38,7 @@ main() {
PACKAGETYPE="apt" PACKAGETYPE="apt"
# Third-party keyrings became the preferred method of # Third-party keyrings became the preferred method of
# installation in Ubuntu 20.04. # installation in Ubuntu 20.04.
if [ "$VERSION_ID" =~ ^2 ]; then if expr "$VERSION_ID" : "2.*" >/dev/null; then
APT_KEY_TYPE="keyring" APT_KEY_TYPE="keyring"
else else
APT_KEY_TYPE="legacy" APT_KEY_TYPE="legacy"
@ -72,7 +72,7 @@ main() {
OS="$ID" OS="$ID"
VERSION="$VERSION_ID" VERSION="$VERSION_ID"
PACKAGETYPE="dnf" PACKAGETYPE="dnf"
if [ "$VERSION" =~ ^7 ]; then if expr "$VERSION" : "7.*" >/dev/null; then
PACKAGETYPE="yum" PACKAGETYPE="yum"
fi fi
;; ;;

Loading…
Cancel
Save