Rev 2875 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log
Rev 2875 | Rev 2878 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/bin/bash |
1 | #!/bin/bash |
2 | # $Id: alcasar-daemon.sh |
2 | # $Id: alcasar-daemon.sh 2878 2020-11-01 21:48:35Z 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 24... | Line 24... | ||
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 |
27 | if [ $service == 'gammu-smsd' ]; then |
28 | /usr/local/bin/alcasar-sms.sh --start |
28 | /usr/local/bin/alcasar-sms.sh --start |
29 | else |
- | |
30 | /usr/bin/systemctl start $service.service |
- | |
31 | fi |
29 | fi |
- | 30 | if [ $service == 'sshd' ]; then |
|
- | 31 | [ -s /etc/ssh/ssh_host_rsa_key ] || rm -f /etc/ssh/ssh_host_* # sometimes sshd doesn't initialise its keys |
|
- | 32 | fi |
|
- | 33 | /usr/bin/systemctl start $service.service |
|
32 | else |
34 | else |
33 | nb_srv=$((nb_srv+1)) |
35 | nb_srv=$((nb_srv+1)) |
34 | fi |
36 | fi |
35 | } |
37 | } |
36 | 38 |