summaryrefslogtreecommitdiff
path: root/community-testing/p3scan/rc.p3scan
diff options
context:
space:
mode:
Diffstat (limited to 'community-testing/p3scan/rc.p3scan')
-rw-r--r--community-testing/p3scan/rc.p3scan39
1 files changed, 39 insertions, 0 deletions
diff --git a/community-testing/p3scan/rc.p3scan b/community-testing/p3scan/rc.p3scan
new file mode 100644
index 000000000..fc8b79b22
--- /dev/null
+++ b/community-testing/p3scan/rc.p3scan
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting p3scan"
+ [ -d /var/run/p3scan ] || mkdir -p /var/run/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