Update nodemgmt-scripts.sh

This commit is contained in:
2021-06-27 19:43:11 -05:00
parent 644dcbc2c0
commit eb94fb1f6f

View File

@@ -1427,25 +1427,35 @@ SERVICE(){
else else
NCMD="ssh root@${nip}" NCMD="ssh root@${nip}"
fi fi
if [ "${3}" != "q" ]; then
echo -en "${NM_SRVCOPTS[${2}]}ing on ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip)... ${idsCL[Default]}" $GO=true;
fi if [ "${2}" = "gitea" ]; then
checkhost=$(CHECK_HOST ${nip}) if [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *10.5.10.120* ]]; then
if [ "${checkhost}" != "false" ]; then $GO=false;
$NCMD systemctl $2 $1 fi
if [ "${3}" != "q" ]; then fi
if [[ "enable,disable" = *"${2}"* ]] || [ "${1}" = "daemon-reload" ]; then
echo -e "${idsCL[Green]}OK${idsCL[Default]}" if [ "${GO}" == "true" ]; then
elif [ "$(${NCMD} systemctl is-active ${1})" = "active" ]; then if [ "${3}" != "q" ]; then
echo -e "${idsCL[Green]}OK${idsCL[Default]}" echo -en "${NM_SRVCOPTS[${2}]}ing on ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip)... ${idsCL[Default]}"
elif [ "$2" = "stop" ]; then fi
echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" checkhost=$(CHECK_HOST ${nip})
else if [ "${checkhost}" != "false" ]; then
echo -e "${idsCL[Red]}ERROR${idsCL[Default]}" $NCMD systemctl $2 $1
fi if [ "${3}" != "q" ]; then
if [[ "enable,disable" = *"${2}"* ]] || [ "${1}" = "daemon-reload" ]; then
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
elif [ "$(${NCMD} systemctl is-active ${1})" = "active" ]; then
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
elif [ "$2" = "stop" ]; then
echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
else
echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
fi
fi
elif [ "${3}" != "q" ]; then
echo -e "${idsCL[Red]}Node is Down${idsCL[Default]}"
fi fi
elif [ "${3}" != "q" ]; then
echo -e "${idsCL[Red]}Node is Down${idsCL[Default]}"
fi fi
# fi # fi
nid=`expr $nid + 1` nid=`expr $nid + 1`