Subversion Repositories ALCASAR

Rev

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

Rev 2864 Rev 2875
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-daemon.sh 2864 2020-10-18 09:06:17Z rexy $
2
# $Id: alcasar-daemon.sh 2875 2020-11-01 10:50:57Z 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 22... Line 22...
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
25
		logger -t alcasar-daemon -i "$service is inactive. Activation attempt"
25
		logger -t alcasar-daemon -i "$service is inactive. Activation attempt"
26
		echo "the $service service is disabled! trying to start it..."
26
		echo "the $service service is disabled! trying to start it..."
-
 
27
		if [ $service == 'gammu-smsd' ]; then
-
 
28
			/usr/local/bin/alcasar-sms.sh --start
-
 
29
		else
27
		/usr/bin/systemctl start $service.service
30
			/usr/bin/systemctl start $service.service
-
 
31
		fi
28
	else
32
	else
29
		nb_srv=$((nb_srv+1))
33
		nb_srv=$((nb_srv+1))
30
	fi
34
	fi
31
}
35
}
32
 
36
 
Line 71... Line 75...
71
fi
75
fi
72
if [ ! -e /etc/raddb/mods-enabled/ldap ]
76
if [ ! -e /etc/raddb/mods-enabled/ldap ]
73
then
77
then
74
	if [ $LDAP == "ON" ] || [ $LDAP == "on" ] || [ $LDAP == "On" ]
78
	if [ $LDAP == "ON" ] || [ $LDAP == "on" ] || [ $LDAP == "On" ]
75
	then
79
	then
76
	echo "Enable LDAP..."
80
		echo "Enabling LDAP..."
77
	/usr/local/bin/alcasar-ldap.sh -on
81
		/usr/local/bin/alcasar-ldap.sh -on
78
	fi
82
	fi
79
fi
83
fi
80
 
84