Make change/unchange language clearer
authorJay Pfaffman <pfaffman@relaxpc.com>
Wed, 20 Apr 2016 18:34:09 +0000 (13:34 -0500)
committerJay Pfaffman <pfaffman@relaxpc.com>
Wed, 20 Apr 2016 18:34:09 +0000 (13:34 -0500)
launcher

index cb0bef0df4b167ee032df9cb2e95ff1b8f6c074a..b0b96707121261aa5aae96057b83a02037223e01 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -491,14 +491,18 @@ run_memconfig(){
   else
     db_shared_buffers=`expr $avail_gb \* 256`
   fi
-  echo -e "Setting db_shared_buffers to ${db_shared_buffers}GB\c"
+  echo -e "Recommend setting for db_shared_buffers: ${db_shared_buffers}GB"
   sed -i -e "s/^  #db_shared_buffers:.*/  db_shared_buffers: \"${db_shared_buffers}GB\"/w $changelog" $config_file
   if [ -s $changelog ]
   then
-    echo " successfully."
+    echo "db_shared_buffers set successfully."
     rm $changelog
-  else
-    echo -e ". . . oops!\n---> db_shared_buffers not found in $config_file."
+  else if grep "^  db_shared_buffers:" $config_file
+     then
+       echo "db_shared_buffers already set. Unchanged."
+     else
+       echo -e ". . . oops!\n---> db_shared_buffers not found in $config_file."
+     fi
   fi
 
   # set UNICORN_WORKERS: 2*GB or 2*cores (the same on DO)
@@ -509,14 +513,18 @@ run_memconfig(){
     unicorn_workers=`expr $avail_cores \* 2`
   fi
 
-  echo -e "Setting UNICORN_WORKERS to $unicorn_workers\c"
+  echo -e "Recommended setting UNICORN_WORKERS: $unicorn_workers"
   sed -i -e "s/^  #UNICORN_WORKERS:.*/  UNICORN_WORKERS: ${unicorn_workers}/w $changelog" $config_file
   if [ -s $changelog ]
   then
-      echo " successfully."
+      echo "UNICORN_WORKERS set successfully."
       rm $changelog
-  else
-    echo -e ". . . oops!\n---> UNICORN_WORKERS not found in $config_file.\n"
+  else if grep "^  UNICORN_WORKERS:" $config_file
+     then
+       echo "UNICORN_WORKERS already set. Unchanged."
+     else
+       echo -e ". . . oops!\n---> UNICORN_WORKERS not found in $config_file.\n"
+     fi
   fi
 }