Subversion Repositories ALCASAR

Rev

Rev 2620 | Rev 2771 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2620 Rev 2688
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-daemon.sh 2620 2018-08-23 22:35:52Z rexy $
2
# $Id: alcasar-daemon.sh 2688 2019-01-18 23:15:49Z lucas.echard $
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 dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole radiusd tinyproxy nfsen e2guardian 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 nfsen e2guardian 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