Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-daemon.sh 2764 2019-11-11 23:07:44Z rexy $
|
2 |
# $Id: alcasar-daemon.sh 2771 2020-02-22 09:50:24Z rexy $
|
3 |
|
3 |
|
4 |
# alcasar-daemon.sh
|
4 |
# alcasar-daemon.sh
|
5 |
# by Franck BOUIJOUX & Rexy
|
5 |
# by Franck BOUIJOUX & Rexy
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
# Watchdog of Services
|
7 |
# Watchdog of Services
|
Line 14... |
Line 14... |
14 |
SMS=${SMS:=off}
|
14 |
SMS=${SMS:=off}
|
15 |
LDAP=`grep ^LDAP= $conf_file|cut -d"=" -f2` # ldap active (on/off)
|
15 |
LDAP=`grep ^LDAP= $conf_file|cut -d"=" -f2` # ldap active (on/off)
|
16 |
LDAP=${LDAP:=off}
|
16 |
LDAP=${LDAP:=off}
|
17 |
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2` # INTIF name
|
17 |
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2` # INTIF name
|
18 |
EXTIF=`grep ^EXTIF= $conf_file|cut -d"=" -f2` # EXTIF name
|
18 |
EXTIF=`grep ^EXTIF= $conf_file|cut -d"=" -f2` # EXTIF name
|
19 |
SERVICES="mysqld lighttpd php-fpm ntpd havp unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole radiusd tinyproxy nfsen e2guardian clamav-freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat gammu-smsd"
|
19 |
SERVICES="mysqld lighttpd php-fpm ntpd havp unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole radiusd tinyproxy nfcapd e2guardian clamav-freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat gammu-smsd"
|
20 |
nb_available_srv=`echo $SERVICES|wc -w`
|
20 |
nb_available_srv=`echo $SERVICES|wc -w`
|
21 |
|
21 |
|
22 |
function ServiceTest () {
|
22 |
function ServiceTest () {
|
23 |
service=$1
|
23 |
service=$1
|
24 |
if [ $(/usr/bin/systemctl is-active $service) != "active" ]; then
|
24 |
if [ $(/usr/bin/systemctl is-active $service) != "active" ]; then
|