aboutsummaryrefslogtreecommitdiff
path: root/package/mrp/S65mrp
diff options
context:
space:
mode:
Diffstat (limited to 'package/mrp/S65mrp')
-rw-r--r--package/mrp/S65mrp55
1 files changed, 55 insertions, 0 deletions
diff --git a/package/mrp/S65mrp b/package/mrp/S65mrp
new file mode 100644
index 0000000000..0ce1f80f81
--- /dev/null
+++ b/package/mrp/S65mrp
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Start mrp
+#
+
+DAEMON="mrp_server"
+
+PIDFILE="/var/run/$DAEMON.pid"
+
+# shellcheck source=/dev/null
+[ -r "/etc/default/mrp_server" ] && . "/etc/default/mrp_server"
+
+start() {
+ printf "Starting mrp daemon: "
+ start-stop-daemon -S -b -q -m -p $PIDFILE \
+ -x /usr/bin/$DAEMON
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return $status
+}
+
+stop() {
+ printf "Stopping mrp daemon: "
+ start-stop-daemon -K -q -p $PIDFILE
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ rm -f "$PIDFILE"
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return $status
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?