From 8d42f6ea266c9760f7632e70154b06358d5c0b13 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 13 Nov 2023 15:03:07 -0600 Subject: [PATCH] update --- inc/certs.inc | 4 ++-- inc/sites.inc | 8 ++++---- nodemgmt-scripts.sh | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/inc/certs.inc b/inc/certs.inc index f95c0964..9812c1f5 100755 --- a/inc/certs.inc +++ b/inc/certs.inc @@ -11,7 +11,7 @@ NEWCERT(){ -expand) CERTEXPAND='--expand';; -h|-help|--help) echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] newcert {hostname}${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -t|-test" "(enables dry-run mode for CertBot)" printf "%-${width}s- %s\n" " {hostname}" "(optional: enter hostname for new cert, comma-delimited for multiple)" echo -e "}\n" @@ -175,7 +175,7 @@ LISTCERTS(){ -s|-search) SEARCH=${2};; -h | -help | --help) echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] certs${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -e|-edit" "(enables edit mode)" printf "%-${width}s- %s\n" " -s|-search {search}" "(narrows list to cert names containing {search})" echo -e "}\n" diff --git a/inc/sites.inc b/inc/sites.inc index 911b58c6..06c2ac94 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -9,7 +9,7 @@ DELSITE(){ echo "Invalid option: '${1}' requires an argument" 1>&2 echo echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] delsite${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" printf "%-${width}s- %s\n" " -ssl {yes or [no]}" "Delete SSL certs as well" printf "%-${width}s- %s\n" " -list" "List sites (same as running nodemgmt delsites)" @@ -61,7 +61,7 @@ DELSITE(){ echo "Missing arguments" echo echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] delsite${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -site {FQDN address}" "Site to delete" printf "%-${width}s- %s\n" " -ssl {yes or [no]}" "Delete SSL certs as well" printf "%-${width}s- %s\n" " -list" "List sites (same as running nodemgmt delsites)" @@ -179,7 +179,7 @@ NEWSITE(){ -h | -help | --help) echo echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] newcert${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -site {FQDN address(,es)}" "(new site and aliases, comma separated)" printf "%-${width}s- %s\n" " -ssl {yes or no}" "(defaults to yes)" printf "%-${width}s- %s\n" " -type {'local' or 'proxy'}" "(defaults to local)" @@ -624,7 +624,7 @@ SITEINFO(){ -s|-search) SEARCH=${2};; -h | -help | --help) echo -e "Usage: ${idsCL[LightYellow]}[nodemgmt or nmg] sites ${idsCL[Yellow]}{flags}${idsCL[Default]} {" - width=33 + width=35 printf "%-${width}s- %s\n" " -e|-edit" "(enables edit mode)" printf "%-${width}s- %s\n" " -s|-search {search}" "(narrows list to hostnames containing {search})" echo -e "}\n" diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 4591fdbc..44bba2d0 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1001,21 +1001,29 @@ GUI(){ checkdocker) CHECK_DOCKER_SERVICES ${2};; set-permissions) SET-PERMISSIONS ${2};; service) - if [[ ( "$2" = "giteax" ) || ( "$2" = "powerdns-admin" ) ]] && [ "$3" = "start" ]; then + if [ "${2}" = "-h" ]; then + echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] service {service} {action}${idsCL[Default]} {" + width=35 + printf "%-${width}s- %s\n" " {service}" "(service name, ex. nginx)" + printf "%-${width}s- %s\n" " {action}" "(start/stop/restart/reload/status)" + echo -e "}\n" + exit 0 + + elif [[ ( "${2}" = "giteax" ) || ( "${2}" = "powerdns-admin" ) ]] && [ "$3" = "start" ]; then #SET-PERMISSIONS ${2} SERVICE ${2} start - elif [[ ( "$2" = "giteax" ) || ( "$2" = "powerdns-admin" ) ]] && [ "$3" = "restart" ]; then + elif [[ ( "${2}" = "giteax" ) || ( "${2}" = "powerdns-admin" ) ]] && [ "$3" = "restart" ]; then SERVICE ${2} stop #SET-PERMISSIONS ${2} SERVICE ${2} start - elif [ "$2" = "web" ]; then + elif [ "${2}" = "web" ]; then SERVICE php5.6-fpm ${3} ${4} SERVICE php7.2-fpm ${3} ${4} SERVICE php7.3-fpm ${3} ${4} SERVICE php7.4-fpm ${3} ${4} SERVICE php8.2-fpm ${3} ${4} SERVICE nginx ${3} ${4} - elif [ "$2" = "glusterdxx" ]; then + elif [ "${2}" = "glusterdxx" ]; then SERVICE glusterd stop else SERVICE ${2} ${3} ${4}