Subversion Repositories ALCASAR

Rev

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

Rev 2040 Rev 2454
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-daemon.sh 2040 2016-08-18 07:18:41Z franck $
2
# $Id: alcasar-daemon.sh 2454 2017-12-09 18:59:31Z 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 17... Line 17...
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 -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
26
}
26
}
27
 
27
 
28
nb_srv=0
28
nb_srv=0
29
for s in $SERVICES
29
for s in $SERVICES
30
do
30
do
31
	if [ $s != "sshd" ] 
31
	if [ $s != "sshd" ]
32
	then
32
	then
33
		ServiceTest
33
		ServiceTest
34
	else
34
	else
35
		{
35
		{
36
		if [ $SSH == "ON" ] || [ $SSH == "on" ] || [ $SSH == "On" ]
36
		if [ $SSH == "ON" ] || [ $SSH == "on" ] || [ $SSH == "On" ]
37
	    	then
37
		then
38
			ServiceTest
38
			ServiceTest
39
		else
39
		else
40
			nb_available_srv=$((nb_available_srv-1))		
40
			nb_available_srv=$((nb_available_srv-1))		
41
		fi
41
		fi
42
		}
42
		}