HEX
Server: Apache/2.2.22
System: Linux server1.blueharbor.com 3.10.0-1160.90.1.vz7.200.7 #1 SMP Wed Jul 12 12:00:44 MSK 2023 x86_64
User: locglobe (1004)
PHP: 5.6.37
Disabled: NONE
Upload Files
File: //usr/local/bin/svcMonitor-systemd
#!/bin/bash
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin 
for i in `cat /usr/local/etc/services-monitor-systemd`
do
CWPSERVICESTATUS=`systemctl is-active $i`
  if [[ ("$CWPSERVICESTATUS" != "active") ]]
  then
    echo Restarted service $i on `hostname` at `date`
    systemctl stop $i
    sleep 1
    systemctl start $i
  fi
done