Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1368,36 +1368,36 @@ SERVICE(){
|
|||||||
|
|
||||||
if [ "$1" = "glusterd" ]; then
|
if [ "$1" = "glusterd" ]; then
|
||||||
|
|
||||||
# for nip in "${GL_HOSTS[@]}"; do
|
for nip in "${GL_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
|
||||||
# nip='localhost '
|
nip='localhost '
|
||||||
# NCMD=''
|
NCMD=''
|
||||||
# else
|
else
|
||||||
# NCMD="ssh root@${nip}"
|
NCMD="ssh root@${nip}"
|
||||||
# fi
|
fi
|
||||||
#
|
|
||||||
# if [ "${3}" != "q" ]; then
|
if [ "${3}" != "q" ]; then
|
||||||
# echo -en "${NM_SRVCOPTS[${2}]}ing on '$nip'... ${idsCL[Default]}"
|
echo -en "${NM_SRVCOPTS[${2}]}ing on '$nip'... ${idsCL[Default]}"
|
||||||
# fi
|
fi
|
||||||
# checkhost=$(CHECK_HOST ${nip})
|
checkhost=$(CHECK_HOST ${nip})
|
||||||
# if [ "${checkhost}" != "false" ]; then
|
if [ "${checkhost}" != "false" ]; then
|
||||||
# #$NCMD systemctl $2 $1
|
$NCMD systemctl $2 $1 > /dev/null 2>&1
|
||||||
# if [ "${3}" != "q" ]; then
|
if [ "${3}" != "q" ]; then
|
||||||
# if [[ "enable,disable" = *"${2}"* ]] || [ "${1}" = "daemon-reload" ]; then
|
if [[ "enable,disable" = *"${2}"* ]] || [ "${1}" = "daemon-reload" ]; then
|
||||||
# echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
||||||
# elif [ "$(${NCMD} systemctl is-active ${1})" = "active" ]; then
|
elif [ "$(${NCMD} systemctl is-active ${1})" = "active" ]; then
|
||||||
# echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
||||||
# elif [ "$2" = "stop" ]; then
|
elif [ "$2" = "stop" ]; then
|
||||||
# echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
|
echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
|
||||||
# else
|
else
|
||||||
# echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
|
echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
|
||||||
# fi
|
fi
|
||||||
# fi
|
fi
|
||||||
# elif [ "${3}" != "q" ]; then
|
elif [ "${3}" != "q" ]; then
|
||||||
# echo -e "${idsCL[Red]}Node is Down${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Node is Down${idsCL[Default]}"
|
||||||
# fi
|
fi
|
||||||
#
|
|
||||||
# done
|
done
|
||||||
|
|
||||||
if [ "${2}" = "start" ] || [ "${2}" = "restart" ]; then
|
if [ "${2}" = "start" ] || [ "${2}" = "restart" ]; then
|
||||||
|
|
||||||
@@ -1417,7 +1417,7 @@ SERVICE(){
|
|||||||
fi
|
fi
|
||||||
checkhost=$(CHECK_HOST ${nip})
|
checkhost=$(CHECK_HOST ${nip})
|
||||||
if [ "${checkhost}" != "false" ]; then
|
if [ "${checkhost}" != "false" ]; then
|
||||||
#$NCMD mount -a
|
$NCMD mount -a > /dev/null 2>&1
|
||||||
if [ "${3}" != "q" ]; then
|
if [ "${3}" != "q" ]; then
|
||||||
if [[ "${NCHOSTS}" == *"${nip}"* ]]; then
|
if [[ "${NCHOSTS}" == *"${nip}"* ]]; then
|
||||||
mntpath="/mnt/Nextcloud-Data"
|
mntpath="/mnt/Nextcloud-Data"
|
||||||
@@ -1426,9 +1426,9 @@ SERVICE(){
|
|||||||
fi
|
fi
|
||||||
${NCMD} "test -e ${mntpath}/mounted"
|
${NCMD} "test -e ${mntpath}/mounted"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "${idsCL[Green]}MOUNTED${idsCL[Default]}"
|
echo -e "${idsCL[Green]}MOUNTED ($mntpath)${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Red]}NOT MOUNTED${idsCL[Default]}"
|
echo -e "${idsCL[Red]}NOT MOUNTED ($mntpath)${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [ "${3}" != "q" ]; then
|
elif [ "${3}" != "q" ]; then
|
||||||
@@ -1444,7 +1444,7 @@ SERVICE(){
|
|||||||
for NTYPE in "${NODE_TYPES[@]}"; do
|
for NTYPE in "${NODE_TYPES[@]}"; do
|
||||||
var=${NTYPE}_HOSTS[@]
|
var=${NTYPE}_HOSTS[@]
|
||||||
for nip in "${!var}"; do
|
for nip in "${!var}"; do
|
||||||
if [[ IP == *"${nip}"* ]]; then
|
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
|
||||||
NODE_TYPE=${NTYPE};
|
NODE_TYPE=${NTYPE};
|
||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user