summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2018-05-29 11:49:38 +0200
committerkwadronaut <kwadronaut@leap.se>2018-05-29 12:08:43 +0200
commit0949724ef67253cebee51d3323f2318b0bdcd46f (patch)
treeeb53efb3b757c826dc06c0bc6fcb88da5d04bb93
parent1de4fe1de57387ca937055257bee5b5b176bae69 (diff)
Bug: let node init also support stretch
Currently it will spit out a warning when on stretch but continue, jessie is still supported. Others will give an error. Related #8916 Fixes #8922
-rwxr-xr-xbin/node_init9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/node_init b/bin/node_init
index 24345b47..488f189b 100755
--- a/bin/node_init
+++ b/bin/node_init
@@ -4,7 +4,8 @@
# This script is run on the target server when `leap node init` is run.
#
-DEBIAN_VERSION="^(jessie|8\.)"
+DEBIAN_JESSIE="^(jessie|8\.)"
+DEBIAN_STRETCH="^(stretch|9\.)"
LEAP_DIR="/srv/leap"
HIERA_DIR="/etc/leap"
INIT_FILE="/srv/leap/initialized"
@@ -17,8 +18,10 @@ BAD_APT_RESPONSE="(BADSIG|NO_PUBKEY|KEYEXPIRED|REVKEYSIG|NODATA|Could not resolv
export DEBIAN_FRONTEND=noninteractive
test -f $INIT_FILE && rm $INIT_FILE
-if ! egrep -q "$DEBIAN_VERSION" /etc/debian_version; then
- echo "ERROR: This operating system is not supported. The file /etc/debian_version must match /$DEBIAN_VERSION/ but is: `cat /etc/debian_version`"
+if egrep -q "$DEBIAN_STRETCH" /etc/debian_version; then
+ echo "WARNING: This operating system is under development. The file /etc/debian_version must match /$DEBIAN_JESSIE/ but is: `cat /etc/debian_version`"
+ elif ! egrep -q "$DEBIAN_JESSIE" /etc/debian_version; then
+ echo "ERROR: This operating system is not supported. The file /etc/debian_version must match /$DEBIAN_JESSIE/ but is: `cat /etc/debian_version`"
exit 1
fi
mkdir -p $LEAP_DIR