update
This commit is contained in:
@@ -18,14 +18,14 @@ case "$1" in
|
||||
echo -e "${idsCL[Red]}(${3}) is not an allowed service action.${idsCL[Default]}"
|
||||
exit 1
|
||||
fi
|
||||
if [ "${idsNMservices[${2}]}" = "" ]; then idsNMservices[${2}]="${srvc}"; fi
|
||||
if [ "${NM_SERVICES[${2}]}" = "" ]; then NM_SERVICES[${2}]="${srvc}"; fi
|
||||
if [ "$3" = "stop" ]; then ADISP='Stopp';
|
||||
elif [ "$3" = "enable" ]; then ADISP='Enabl';
|
||||
elif [ "$3" = "disable" ]; then ADISP='Disabl';
|
||||
else ADISP="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}"; fi
|
||||
if [ "$3" = "start" ] && [ "$2" = "haproxy" ]; then TACT='restart'; else TACT="${3}"; fi
|
||||
|
||||
echo -e "${idsCL[LightGreen]}[[${idsNMservices[${srvc}]} ${ADISP}ing]]${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightGreen]}[[${NM_SERVICES[${srvc}]} ${ADISP}ing]]${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}"
|
||||
|
||||
nid=1
|
||||
@@ -50,7 +50,7 @@ case "$1" in
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -e "${idsCL[Green]}${idsNMservices[${srvc}]} has been ${ADISP}ed${idsCL[Default]}"
|
||||
echo -e "${idsCL[Green]}${NM_SERVICES[${srvc}]} has been ${ADISP}ed${idsCL[Default]}"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
@@ -110,8 +110,8 @@ case "$1" in
|
||||
|
||||
for srvc in "${NODE_SERVICES[@]}"
|
||||
do
|
||||
if [ "${idsNMservices[${srvc}]}" = "" ]; then idsNMservices[${srvc}]="${srvc}"; fi
|
||||
echo -en "${idsNMservices[${srvc}]} "
|
||||
if [ "${NM_SERVICES[${srvc}]}" = "" ]; then NM_SERVICES[${srvc}]="${srvc}"; fi
|
||||
echo -en "${NM_SERVICES[${srvc}]} "
|
||||
if [ $(${NCMD} pgrep ${srvc} | wc -l) -gt "0" ]; then
|
||||
echo -e "${idsCL[Green]}Running${idsCL[Default]}"
|
||||
else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||
@@ -133,10 +133,10 @@ case "$1" in
|
||||
fi
|
||||
for srvc in "${NODE_SERVICES[@]}"
|
||||
do
|
||||
if [ "${idsNMservices[${srvc}]}" = "" ]; then idsNMservices[${srvc}]="${srvc}"; fi
|
||||
if [ "${NM_SERVICES[${srvc}]}" = "" ]; then NM_SERVICES[${srvc}]="${srvc}"; fi
|
||||
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then
|
||||
if [ $(${NCMD} pgrep ${srvc} | wc -l) -lt "1" ]; then
|
||||
echo "${idsNMservices[${srvc}]} is down" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL}
|
||||
echo "${NM_SERVICES[${srvc}]} is down" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user