Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar-daemon.sh 2537 2018-04-30 04:07:45Z tom.houdayer $
|
2 |
# $Id: alcasar-daemon.sh 2572 2018-07-20 16:55:00Z 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 |
# See /etc/cron.d/alcasar-daemon-watchdog for config the time
|
8 |
# See /etc/cron.d/alcasar-daemon-watchdog for config the time
|
9 |
|
9 |
|
10 |
conf_file="/usr/local/etc/alcasar.conf"
|
10 |
conf_file="/usr/local/etc/alcasar.conf"
|
11 |
SSH=`grep ^SSH= $conf_file|cut -d"=" -f2` # sshd active (on/off)
|
11 |
SSH=`grep ^SSH= $conf_file|cut -d"=" -f2` # sshd active (on/off)
|
12 |
SSH=${SSH:=off}
|
12 |
SSH=${SSH:=off}
|
- |
|
13 |
LDAP=`grep ^LDAP= $conf_file|cut -d"=" -f2` # ldap active (on/off)
|
- |
|
14 |
LDAP=${SSH:=off}
|
13 |
SERVICES="mysqld lighttpd php-fpm ntpd havp dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole radiusd tinyproxy nfsen e2guardian freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat"
|
15 |
SERVICES="mysqld lighttpd php-fpm ntpd havp dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole radiusd tinyproxy nfsen e2guardian freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat"
|
14 |
nb_available_srv=`echo $SERVICES|wc -w`
|
16 |
nb_available_srv=`echo $SERVICES|wc -w`
|
15 |
|
17 |
|
16 |
function ServiceTest () {
|
18 |
function ServiceTest () {
|
17 |
CMD=`/usr/bin/systemctl is-active $s`
|
19 |
CMD=`/usr/bin/systemctl is-active $s`
|
Line 55... |
Line 57... |
55 |
logger -t alcasar-daemon -i "ipt_netflow is inactive."
|
57 |
logger -t alcasar-daemon -i "ipt_netflow is inactive."
|
56 |
echo "The Log system is disabled! try to know why (modprobe ipt_NETFLOW)"
|
58 |
echo "The Log system is disabled! try to know why (modprobe ipt_NETFLOW)"
|
57 |
else
|
59 |
else
|
58 |
echo "The Log system is active"
|
60 |
echo "The Log system is active"
|
59 |
fi
|
61 |
fi
|
- |
|
62 |
if [ ! -e /etc/raddb/mods-enabled/ldap ]
|
- |
|
63 |
then
|
- |
|
64 |
if [ $LDAP == "ON" ] || [ $LDAP == "on" ] || [ $LDAP == "On" ]
|
- |
|
65 |
then
|
- |
|
66 |
echo "Enable LDAP..."
|
- |
|
67 |
/usr/local/bin/alcasar-ldap.sh -on
|
- |
|
68 |
fi
|
- |
|
69 |
fi
|