Subversion Repositories ALCASAR

Rev

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

Rev 3043 Rev 3099
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-daemon.sh 3043 2022-07-22 17:10:23Z rexy $
2
# $Id: alcasar-daemon.sh 3099 2022-12-28 11:30:30Z 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 13... Line 13...
13
SMS=${SMS:=off}
13
SMS=${SMS:=off}
14
LDAP=`grep ^LDAP= $conf_file|cut -d"=" -f2`				# ldap active (on/off)
14
LDAP=`grep ^LDAP= $conf_file|cut -d"=" -f2`				# ldap active (on/off)
15
LDAP=${LDAP:=off}
15
LDAP=${LDAP:=off}
16
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2`				# INTIF name
16
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2`				# INTIF name
17
EXTIF=`grep ^EXTIF= $conf_file|cut -d"=" -f2`				# EXTIF name
17
EXTIF=`grep ^EXTIF= $conf_file|cut -d"=" -f2`				# EXTIF name
18
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"
18
SERVICES="mysqld lighttpd php-fpm ntpd unbound unbound-blacklist unbound-whitelist unbound-blackhole radiusd nfcapd e2guardian clamav-daemon clamav-freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat gammu-smsd"
19
nb_available_srv=`echo $SERVICES|wc -w`
19
nb_available_srv=`echo $SERVICES|wc -w`
20
 
20
 
21
function ServiceTest () {
21
function ServiceTest () {
22
	service=$1
22
	service=$1
23
	if [ $(/usr/bin/systemctl is-active $service) != "active" ]; then
23
	if [ $(/usr/bin/systemctl is-active $service) != "active" ]; then