| Line 1... | 
            Line 1... | 
          
          
            | 1 | 
            #!/bin/sh
  | 
            1 | 
            #!/bin/sh
  | 
          
          
            | 2 | 
            # $Id: alcasar-daemon.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
  | 
            2 | 
            # $Id: alcasar-daemon.sh 2474 2017-12-30 02:00:04Z 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
  | 
          
          
            | 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 | 
            SERVICES="mysqld httpd ntpd havp dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole radiusd tinyproxy nfsen dansguardian freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat"
  | 
            13 | 
            SERVICES="mysqld httpd ntpd havp dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole radiusd tinyproxy nfsen dansguardian freshclam ulogd-ssh ulogd-traceability ulogd-ext-access chilli fail2ban sshd vnstat"
  | 
          
          
            | 14 | 
            nb_available_srv=`echo $SERVICES|wc -w`
  | 
            14 | 
            nb_available_srv=`echo $SERVICES|wc -w`
  | 
          
          
            | 15 | 
             
  | 
            15 | 
             
  | 
          
          
            | 16 | 
            function ServiceTest () {
  | 
            16 | 
            function ServiceTest () {
  |