mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
39 lines
728 B
Text
39 lines
728 B
Text
|
#!/bin/bash
|
||
|
|
||
|
. /etc/rc.conf
|
||
|
. /etc/rc.d/functions
|
||
|
|
||
|
case "$1" in
|
||
|
start)
|
||
|
stat_busy "Starting p3scan"
|
||
|
if [ -a /var/run/p3scan/p3scan.pid ]; then stat_die; fi
|
||
|
|
||
|
# Start p3scan
|
||
|
/usr/sbin/p3scan
|
||
|
if ! [ -a /var/run/p3scan/p3scan.pid ]; then stat_die; fi
|
||
|
add_daemon p3scan
|
||
|
stat_done
|
||
|
;;
|
||
|
stop)
|
||
|
stat_busy "Stopping p3scan"
|
||
|
|
||
|
# Stop p3scan
|
||
|
if [ -a /var/run/p3scan/p3scan.pid ]; then
|
||
|
kill `cat /var/run/p3scan/p3scan.pid` &>/dev/null || stat_die
|
||
|
rm -f /var/run/p3scan/p3scan.pid
|
||
|
rm_daemon p3scan
|
||
|
stat_done
|
||
|
else
|
||
|
stat_fail
|
||
|
fi
|
||
|
;;
|
||
|
restart)
|
||
|
$0 stop
|
||
|
sleep 1
|
||
|
$0 start
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: $0 { start | stop | restart }"
|
||
|
esac
|
||
|
exit 0
|