Update nodemgmt-scripts.sh
This commit is contained in:
@@ -372,7 +372,8 @@ NEWCERT(){
|
|||||||
for nip in "${WEB_HOSTS[@]}"; do
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
||||||
echo "restarting ${nip}"
|
echo "restarting ${nip}"
|
||||||
`ssh root@${nip} service nginx stop`
|
# `ssh root@${nip} service nginx stop`
|
||||||
|
SERVICE nginx stop ${nip}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -422,7 +423,8 @@ NEWCERT(){
|
|||||||
fi
|
fi
|
||||||
for nip in "${WEB_HOSTS[@]}"; do
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
||||||
`ssh root@${nip} service nginx start`
|
# `ssh root@${nip} service nginx start`
|
||||||
|
SERVICE nginx start ${nip}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
@@ -1261,25 +1263,31 @@ SERVICE(){
|
|||||||
nid=1
|
nid=1
|
||||||
var2=${NTYPE}_HOSTS[@]
|
var2=${NTYPE}_HOSTS[@]
|
||||||
for nip in "${!var2}"; do
|
for nip in "${!var2}"; do
|
||||||
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
|
if [ ! -z ${3+x} ] || [ "${3}" == "q" ]; then GO=true;
|
||||||
nip='localhost '
|
elif [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${3}"* ]]; then GO=true;
|
||||||
NCMD=''
|
else GO=false;
|
||||||
else
|
|
||||||
NCMD="ssh root@${nip}"
|
|
||||||
fi
|
fi
|
||||||
if [ "${3}" != "q" ]; then
|
if [ "${GO}" == "true" ]; then
|
||||||
echo -en "${NM_SRVCOPTS[${2}]}ing on ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip)... ${idsCL[Default]}"
|
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
|
||||||
fi
|
nip='localhost '
|
||||||
$NCMD systemctl $2 $1
|
NCMD=''
|
||||||
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
|
else
|
||||||
echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
|
NCMD="ssh root@${nip}"
|
||||||
|
fi
|
||||||
|
if [ "${3}" != "q" ]; then
|
||||||
|
echo -en "${NM_SRVCOPTS[${2}]}ing on ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip)... ${idsCL[Default]}"
|
||||||
|
fi
|
||||||
|
$NCMD systemctl $2 $1
|
||||||
|
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
|
fi
|
||||||
fi
|
fi
|
||||||
nid=`expr $nid + 1`
|
nid=`expr $nid + 1`
|
||||||
|
|||||||
Reference in New Issue
Block a user