summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-07-01 17:34:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-07-01 17:34:03 -0300
commit52c80d9daef676228dec221ad149567d05be5f2f (patch)
treecd24a77fcdad15271c64c380de83fcb099d6990c /share
parent9693fa7b458dee4f05c4903744f83e8621703dbe (diff)
downloadhydra-52c80d9daef676228dec221ad149567d05be5f2f.tar.gz
hydra-52c80d9daef676228dec221ad149567d05be5f2f.tar.bz2
Add a next release parameter on system-upgrade
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/system-upgrade14
1 files changed, 14 insertions, 0 deletions
diff --git a/share/hydractl/system-upgrade b/share/hydractl/system-upgrade
index 0a8e6de..7942813 100755
--- a/share/hydractl/system-upgrade
+++ b/share/hydractl/system-upgrade
@@ -22,6 +22,7 @@ hydra_config_load
# Command line arguments
BASENAME="`basename $0`"
+NEXTRELEASE="$1"
# Available releases
#release="`facter lsbdistcodename`" # this doesn't work on squeeze
@@ -34,6 +35,19 @@ if [ "$?" != "0" ]; then
exit 1
fi
+# Check optional parameter
+if [ ! -z "$NEXTRELEASE" ]; then
+ if [ "$NEXTRELEASE" == "$release" ]; then
+ echo "System is already upgraded to $NEXTRELEASE"
+ exit 1
+ fi
+
+ if [ "$NEXTRELEASE" != "$nextrelease" ]; then
+ echo "Cannot upgrade: next release for this system is $nextrelease"
+ exit 1
+ fi
+fi
+
# Ensure puppet is stopped during the process
echo "Disabling puppet during the upgrade..."
service puppet stop