]> gitweb.fluxo.info Git - hydra.git/commitdiff
Add a next release parameter on system-upgrade
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 1 Jul 2013 20:34:03 +0000 (17:34 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 1 Jul 2013 20:34:03 +0000 (17:34 -0300)
share/hydractl/system-upgrade

index 0a8e6de5ccdeaf0e15e802c1ea99bce58ecb3012..79428137701048b6677d1fc966e936694ed47674 100755 (executable)
@@ -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