Redesign script 'check_cups.sh'.
This commit is contained in:
22
OLD/check_cups.sh
Executable file
22
OLD/check_cups.sh
Executable 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
|
Reference in New Issue
Block a user