Rev 2815 | Rev 2864 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log
Rev 2815 | Rev 2840 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/bin/bash |
1 | #!/bin/bash |
2 | # $Id: alcasar-daemon.sh |
2 | # $Id: alcasar-daemon.sh 2840 2020-06-27 22:35:40Z 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 |
19 | SERVICES="mysqld lighttpd php-fpm ntpd unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole radiusd nfcapd e2guardian clamav-daemon 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 |