Update nodemgmt-scripts.sh
This commit is contained in:
@@ -2042,10 +2042,26 @@ HAPROXY-CONFIG() {
|
|||||||
|
|
||||||
SINGLE_SERVER_SERVICE_CHECK(){
|
SINGLE_SERVER_SERVICE_CHECK(){
|
||||||
if [ "${1}" = "web" ]; then
|
if [ "${1}" = "web" ]; then
|
||||||
|
servicestocheck=gitea,pdnsadmin
|
||||||
|
IFS=,; services_to_check=(${servicestocheck}); unset IFS
|
||||||
|
|
||||||
local_ips=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1);
|
local_ips=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1);
|
||||||
local_ip=$(/sbin/ip -o -4 addr list eth0 |grep 255 | awk '{print $4}' | cut -d/ -f1)
|
local_ip=$(/sbin/ip -o -4 addr list eth0 |grep 255 | awk '{print $4}' | cut -d/ -f1)
|
||||||
if [[ ${local_ips} = *10.10.1.120* ]]; then
|
if [[ ${local_ips} = *10.10.1.120* ]]; then
|
||||||
if [ -f /mnt/web-data/mounted ]; then
|
if [ -f /mnt/web-data/mounted ]; then
|
||||||
|
for stc in "${services_to_check[@]}"; do
|
||||||
|
if [ "$(systemctl is-active stc).service" != "active" ]; then
|
||||||
|
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
|
||||||
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
|
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
||||||
|
echo "stopping ${stc} service on ${nip}"
|
||||||
|
ssh root@${nip} /bin/systemctl stop ${stc}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
/bin/systemctl start gitea &
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$(systemctl is-active gitea)" != "active" ]; then
|
if [ "$(systemctl is-active gitea)" != "active" ]; then
|
||||||
for nip in "${WEB_HOSTS[@]}"; do
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user