#! /bin/bash
# enable cupsd by service:cups:restart, once the service is not running


cd $PWD

# test is cupsd running

ON=`pidof cupsd`

if [ "$ON" -gt "0" ]; then

	/usr/bin/xdg-open http://localhost:631/
else

	gksu -l service cups restart
	PIDcups=`pidof cupsd`
	wait $PIDcups | sleep 1
	/usr/bin/xdg-open http://localhost:631/

fi

exit 0