From c94ebe1cc45954167e4c20464d8057a749c41a35 Mon Sep 17 00:00:00 2001 From: Scott B <28817345+foundObjects@users.noreply.github.com> Date: Sun, 19 Jan 2020 13:28:17 -0800 Subject: [PATCH] patch: refuse to install on non-debian systems --- install.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index aedbaa9..b5b9880 100755 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin # installer main body: _main() { # ensure $1 exists so 'set -u' doesn't error out - [ "$#" -eq "0" ] && { set -- ""; } > /dev/null 2>&1 + { [ "$#" -eq "0" ] && set -- ""; } > /dev/null 2>&1 case "$1" in "--emit") @@ -67,7 +67,24 @@ _uninstall() { _install() { # create hooks and no-subscription repo list, install hook script, run once - RELEASE=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) + VERSION_CODENAME='' + ID='' + . /etc/os-release + case "$ID" in + "debian") + if [ -n "$VERSION_CODENAME" ]; then + RELEASE="$VERSION_CODENAME" + else + RELEASE=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) + fi + ;; + #"ubuntu") # it doesn't look like this is possible anymore + # ;; + *) + echo "Sorry, I don't know how to handle your Linux distribution '$ID'" + exit 1 + ;; + esac # create the pve-no-subscription list echo "Creating PVE no-subscription repo list ..."