summarylogtreecommitdiffstats
path: root/rc.d_rxstack
diff options
context:
space:
mode:
authorDaichi Shinozaki2015-06-09 18:30:22 +0900
committerDaichi Shinozaki2015-06-09 18:30:22 +0900
commit12061b295597d15c4ff3c3f2e42bc681683c8bd4 (patch)
treec7cebc9ee3291083410a65166f8b4100b5816030 /rc.d_rxstack
downloadaur-12061b295597d15c4ff3c3f2e42bc681683c8bd4.tar.gz
Initial import
Diffstat (limited to 'rc.d_rxstack')
-rw-r--r--rc.d_rxstack53
1 files changed, 53 insertions, 0 deletions
diff --git a/rc.d_rxstack b/rc.d_rxstack
new file mode 100644
index 000000000000..3886b05d018a
--- /dev/null
+++ b/rc.d_rxstack
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/bin/rxstack)
+
+stat_started() {
+ deltext
+ printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]${C_CLEAR} \n"
+}
+
+stat_stopped() {
+ deltext
+ printf "${C_OTHER}[${C_DONE}STOPPED${C_OTHER}]${C_CLEAR} \n"
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting Regina Stack"
+ [ -z "${PID}" ] && /usr/bin/rxstack -d &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon rxstack
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Regina Stack"
+ /usr/bin/rxstack -k &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon rxstack
+ stat_done
+ fi
+ ;;
+ status)
+ stat_busy "Regina Stack"
+ echo -en '\b\b\b\b'
+ [ -z "${PID}" ] && stat_stopped
+ [ -z "${PID}" ] || stat_started
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|restart}"
+esac
+exit 0