Subversion Repositories ALCASAR

Rev

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

Rev 2967 Rev 3043
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-daemon.sh 2967 2021-07-08 09:47:39Z rexy $
2
# $Id: alcasar-daemon.sh 3043 2022-07-22 17:10:23Z 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
8
# With the option "-after-update" checks if services or system need to be restarted after a RPM update
8
# With the option "-after-update" checks if services or system need to be restarted after a RPM update
9
# See /etc/cron.d/alcasar-daemon-watchdog for config the time
9
# See /etc/cron.d/alcasar-daemon-watchdog for config the time
10
 
10
 
11
conf_file="/usr/local/etc/alcasar.conf"
11
conf_file="/usr/local/etc/alcasar.conf"
12
SSH=`grep ^SSH= $conf_file|cut -d"=" -f2`				# sshd active (on/off)
-
 
13
SSH=${SSH:=off}
-
 
14
SMS=`grep ^SMS= $conf_file|cut -d"=" -f2`				# SMS active (on/off)
12
SMS=`grep ^SMS= $conf_file|cut -d"=" -f2`				# SMS active (on/off)
15
SMS=${SMS:=off}
13
SMS=${SMS:=off}
16
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)
17
LDAP=${LDAP:=off}
15
LDAP=${LDAP:=off}
18
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2`				# INTIF name
16
INTIF=`grep ^INTIF= $conf_file|cut -d"=" -f2`				# INTIF name
Line 61... Line 59...
61
			fi
59
			fi
62
		done
60
		done
63
		
61
		
64
		nb_srv=0
62
		nb_srv=0
65
		for service in $SERVICES; do
63
		for service in $SERVICES; do
66
			if [ $service == 'sshd' ]; then
-
 
67
				if [ $SSH != "ON" ] && [ $SSH != "on" ] && [ $SSH != "On" ]; then
-
 
68
					nb_available_srv=$((nb_available_srv-1))
-
 
69
					continue
-
 
70
				fi
-
 
71
			elif [ $service == 'gammu-smsd' ]; then
64
			if [ $service == 'gammu-smsd' ]; then
72
				if [ $SMS != "ON" ] && [ $SMS != "on" ] && [ $SMS != "On" ]; then
65
				if [ $SMS != "ON" ] && [ $SMS != "on" ] && [ $SMS != "On" ]; then
73
					nb_available_srv=$((nb_available_srv-1))
66
					nb_available_srv=$((nb_available_srv-1))
74
					continue
67
					continue
75
				fi
68
				fi
76
			fi
69
			fi