mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
4a28157d1c
Signed-off-by: Robby Workman <rworkman@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
33 lines
707 B
Bash
33 lines
707 B
Bash
#!/bin/sh
|
|
#script to start/stop etc epson communication backend daemon ecbd
|
|
|
|
if [ ! -x /usr/lib/epson-backend/ecbd ]; then
|
|
echo "/usr/lib/epson-backend/ecbd not executable"
|
|
exit 1
|
|
fi
|
|
PIDFILE=/var/run/ecbd.pid
|
|
OPT=${1:-start}
|
|
case "$OPT" in
|
|
'start')
|
|
if [ $(ps -A|grep ecbd|grep -v "rc.ecbd"|wc -l) -gt 0 ]||[ -e $PIDFILE ]; then
|
|
echo "ecbd is already running"
|
|
else
|
|
/usr/lib/epson-backend/ecbd -p $PIDFILE &
|
|
fi
|
|
;;
|
|
'stop')
|
|
if [ -e /var/run/ecbd.pid ]; then
|
|
kill $(cat $PIDFILE)
|
|
fi
|
|
rm -f $PIDFILE
|
|
;;
|
|
'restart')
|
|
if [ -e $PIDFILE ]; then
|
|
kill $(cat $PIDFILE)
|
|
fi
|
|
rm -f $PIDFILE
|
|
/usr/lib/epson-backend/ecbd -p $PIDFILE &
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|