eg-brick-manager attach prompt on -attach actions
authorBill Erickson <berickxx@gmail.com>
Thu, 21 May 2015 17:47:43 +0000 (13:47 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Instead of forcing an attach when -g is present, only apply -g when an
explicit attach option (roll-attach, start-attach) is selected.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/admin-scripts/eg-brick-manager.sh

index d73647f..73e7516 100755 (executable)
@@ -123,13 +123,21 @@ function inspect_args {
         if [ "$ACTION" = "roll" ]; then
             EG_UPDATER_OPS="-o"
         elif [ "$ACTION" = "roll-attach" ]; then
-            EG_UPDATER_OPS="-o -a"
+            if [ -n "$PROMPT_ATTACH" ]; then
+                EG_UPDATER_OPS="-og"
+            else
+                EG_UPDATER_OPS="-oa"
+            fi;
         elif [ "$ACTION" = "stop" ]; then
             EG_UPDATER_OPS="-l"
         elif [ "$ACTION" = "start" ]; then
             EG_UPDATER_OPS="-m"
         elif [ "$ACTION" = "start-attach" ]; then
-            EG_UPDATER_OPS="-ma"
+            if [ -n "$PROMPT_ATTACH" ]; then
+                EG_UPDATER_OPS="-mg"
+            else
+                EG_UPDATER_OPS="-ma"
+            fi;
         elif [ "$ACTION" = "detach" ]; then
             EG_UPDATER_OPS="-u"
         elif [ "$ACTION" = "attach" ]; then
@@ -137,10 +145,6 @@ function inspect_args {
         fi
     fi
 
-    if [ -n "$PROMPT_ATTACH" ]; then
-        EG_UPDATER_OPS="$EG_UPDATER_OPS -g"
-    fi
-
     if  [ -z "$LIST_SERVERS" -a -z "$EG_UPDATER_OPS" ]; then
         usage;
     fi