summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-18 17:32:35 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-02-18 17:32:35 -0300
commita0acebce695a2f278bdd522be0ecdfb5c918d2ba (patch)
treee9a3fc1583d8ae487cac0e8aa5169e64a6fb6dd3
parentcd5fb92fdf78fcf3770a7767035ce9fc1e31f172 (diff)
downloadhydra-a0acebce695a2f278bdd522be0ecdfb5c918d2ba.tar.gz
hydra-a0acebce695a2f278bdd522be0ecdfb5c918d2ba.tar.bz2
Better release checking at system-upgrade
-rwxr-xr-xshare/hydractl/system-upgrade8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/hydractl/system-upgrade b/share/hydractl/system-upgrade
index 5dfe126..0a8e6de 100755
--- a/share/hydractl/system-upgrade
+++ b/share/hydractl/system-upgrade
@@ -25,9 +25,15 @@ BASENAME="`basename $0`"
# Available releases
#release="`facter lsbdistcodename`" # this doesn't work on squeeze
-release="`facter | grep lsbdistcodename | sed -e 's/lsbdistcodename => //'`"
+release="`facter 2> /dev/null | grep lsbdistcodename | sed -e 's/lsbdistcodename => //'`"
nextrelease="`hydra_next_debian_release $release`"
+# Check release
+if [ "$?" != "0" ]; then
+ echo "Unsupported release"
+ exit 1
+fi
+
# Ensure puppet is stopped during the process
echo "Disabling puppet during the upgrade..."
service puppet stop