Subversion Repositories ALCASAR

Rev

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

Rev 2534 Rev 2537
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-daemon.sh 2534 2018-04-30 04:00:57Z tom.houdayer $
2
# $Id: alcasar-daemon.sh 2537 2018-04-30 04:07:45Z tom.houdayer $
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 15... Line 15...
15
 
15
 
16
function ServiceTest () {
16
function ServiceTest () {
17
	CMD=`/usr/bin/systemctl is-active $s`
17
	CMD=`/usr/bin/systemctl is-active $s`
18
	if [ $CMD != "active" ]
18
	if [ $CMD != "active" ]
19
	then
19
	then
20
		logger -i "!! $s is inactive. Activation attempt"
20
		logger -t alcasar-daemon -i "$s is inactive. Activation attempt"
21
		echo "the $s service is disabled! trying to start it..."
21
		echo "the $s service is disabled! trying to start it..."
22
		/usr/bin/systemctl start $s.service
22
		/usr/bin/systemctl start $s.service
23
	else
23
	else
24
		nb_srv=$((nb_srv+1))
24
		nb_srv=$((nb_srv+1))
25
	fi
25
	fi
Line 40... Line 40...
40
			nb_available_srv=$((nb_available_srv-1))
40
			nb_available_srv=$((nb_available_srv-1))
41
		fi
41
		fi
42
		}
42
		}
43
	fi
43
	fi
44
done
44
done
45
	
45
 
46
if [ $nb_available_srv -ne $nb_srv ]
46
if [ $nb_available_srv -ne $nb_srv ]
47
then
47
then
48
	echo "Restart this script to know if all is ok"
48
	echo "Restart this script to know if all is ok"
49
else
49
else
50
	echo "$nb_srv services needed by ALCASAR are started."
50
	echo "$nb_srv services needed by ALCASAR are started."
51
fi
51
fi
52
 
52
 
53
if [ `lsmod|grep ipt_NETFLOW|wc -l` == 0 ]
53
if [ `lsmod|grep ipt_NETFLOW|wc -l` == 0 ]
54
then
54
then
55
	logger -i "!! ipt_netflow is inactive."
55
	logger -t alcasar-daemon -i "ipt_netflow is inactive."
56
	echo "The Log system is disabled! try to know why (modprobe ipt_NETFLOW)"
56
	echo "The Log system is disabled! try to know why (modprobe ipt_NETFLOW)"
57
else
57
else
58
	echo "The Log system is active"
58
	echo "The Log system is active"
59
fi
59
fi