summaryrefslogtreecommitdiff
path: root/devel/linux-js/files
diff options
context:
space:
mode:
Diffstat (limited to 'devel/linux-js/files')
-rw-r--r--devel/linux-js/files/jscal.sh.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/devel/linux-js/files/jscal.sh.in b/devel/linux-js/files/jscal.sh.in
new file mode 100644
index 000000000000..ebc4b5d8e77a
--- /dev/null
+++ b/devel/linux-js/files/jscal.sh.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: jscal
+# KEYWORD: shutdown
+
+jscal_enable=${jscal_enable-"NO"}
+jscal_device="/dev/input/js0"
+jscal_state="${jscal_state:-/var/db/jscal-state}"
+
+. %%RC_SUBR%%
+
+name="jscal"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/jscal"
+start_cmd="jscal_start"
+stop_cmd="jscal_stop"
+
+jscal_start()
+{
+ [ -f "$jscal_state" ] && . "$jscal_state" 2>/dev/null
+}
+
+jscal_stop()
+{
+ cal=`"$command" -p "$jscal_device" 2>/dev/null` && \
+ echo "$cal" | sed -e "s|^jscal|$command|" > $jscal_state
+}
+
+load_rc_config $name
+run_rc_command "$1"