summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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