From 86d0094a3f03d730d3621fd97817c387ac1f1405 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 27 Jan 2019 22:58:49 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index a15c9f49..6bbcb77f 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -4,6 +4,7 @@ action="$1" VERS='1.01272019' CERT_DAEMON='/usr/bin/certbot' +SCRIUPT= source /opt/idssys/nodemgmt/settings.conf source /opt/idssys/defaults/colors.inc @@ -19,19 +20,19 @@ unset IFS case "$1" in service) - if [ "$2" = "nginx" ]; then SER='NGINX' + if [ "$2" = "nginx" ]; then SER='NGINX' elif [ "$2" = "haproxy" ]; then SER='HAProxy' elif [ "$2" = "gogs" ]; then SER='Gogs' fi + if [ "$3" = "stop" ]; then ADISP='Stopp'; else ADISP="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}"; fi - STA="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}" - echo -e "${idsCL[LightGreen]}[[${SER} ${STA}ing]]${idsCL[Default]}" + echo -e "${idsCL[LightGreen]}[[${SER} ${ADSIP}ing]]${idsCL[Default]}" echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" nid=1 for nip in "${NODE_HOSTS[@]}" do - echo -en "${STA}ing Node ${nid} ($nip)...${idsCL[Default]}" + echo -en "${ADISP}ing Node ${nid} ($nip)...${idsCL[Default]}" ssh root@${nip} systemctl $3 $2 if [[ $(ssh root@${nip} ps -ef | grep -c ${2}) -ne 1 ]]; then echo -e "${idsCL[Green]}OK${idsCL[Default]}" @@ -41,7 +42,7 @@ case "$1" in done echo "" - echo -e "${idsCL[Green]}${SER} has been ${STA}ed${idsCL[Default]}" + echo -e "${idsCL[Green]}${SER} has been ${ADISP}ed${idsCL[Default]}" echo "" exit 0 ;; @@ -49,9 +50,9 @@ case "$1" in newcert) "$0" service haproxy stop - echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}$2$${idsCL[LightGreen]}'...${idsCL[Default]}" + echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${2}${idsCL[LightGreen]}'...${idsCL[Default]}" # $DAEMON certonly --standalone -d $2 - $DAEMON certonly --webroot -w /var/www/html -d $2 + $CERT_DAEMON certonly --webroot -w /var/www/html -d $2 # chown -R root:letsencrypt /etc/letsencrypt # chmod -R 6775 /etc/letsencrypt "$0" service haproxy start