aboutsummaryrefslogtreecommitdiff
path: root/comms/smstools/files/smsd.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'comms/smstools/files/smsd.sh.in')
-rw-r--r--comms/smstools/files/smsd.sh.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/comms/smstools/files/smsd.sh.in b/comms/smstools/files/smsd.sh.in
new file mode 100644
index 000000000000..5f499bb5bda4
--- /dev/null
+++ b/comms/smstools/files/smsd.sh.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# PROVIDE: smsd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable smsd:
+#
+# smsd_enable="YES"
+#
+smsd_enable=${smsd_enable-"NO"}
+
+. %%RC_SUBR%%
+
+name="smsd"
+rcvar=`set_rcvar`
+load_rc_config $name
+pidfile="/var/run/smsd.pid"
+command="%%PREFIX%%/bin/smsd"
+command_args='&'
+
+# Unfortunally we need to this because as the program won't
+# exit cleanly and the terminal will be stuck forever in waitpid.
+case "$1" in
+ stop)
+ pkill smsd
+ ;;
+ *)
+ run_rc_command "$1"
+ ;;
+esac
+