frater 29 May 2009 16:01
I don't like it when there are processes running on my poor little worldbook if they aren't serving any purpose.
That's why I wrote this little 1-minute cronjob to monitor the existence of a printer.
- cat /etc/cron.min/watchprinter
#!/bin/sh # Printer monitoring script pr_attached=`cat /proc/bus/usb/devices | grep -c usblp` if [ -z "`pidof cupsd`" ]; then [ $pr_attached -ne 0 ] && /opt/sbin/cupsd else [ $pr_attached -eq 0 ] && killall cupsd fi