Redesign script 'check_cups.sh'.

This commit is contained in:
2018-06-02 11:54:39 +02:00
parent 25033030c5
commit 9a02312bda
2 changed files with 274 additions and 11 deletions

22
OLD/check_cups.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
## - Check if cups service is runnning. If service is down
## - start it.
## -
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if ! ps ax | grep /usr/sbin/cupsd | grep -v grep > /dev/null ; then
echo -e "\n\tCups Daemon is not running. So i'm going to (re)start the cups service..\n"
/etc/init.d/cups stop
kill -9 `cat /var/run/cups/cupsd.pid 2>/dev/null` > /dev/null 2>&1
rm -f /var/run/cups/cupsd.pid
## - Start cups daemon
/etc/init.d/cups start
fi
exit 0