diff options
author | Jean-Yves Lefort <jylefort@FreeBSD.org> | 2006-02-05 03:12:50 +0000 |
---|---|---|
committer | Jean-Yves Lefort <jylefort@FreeBSD.org> | 2006-02-05 03:12:50 +0000 |
commit | f52cd3aa81f703112ef39d94230ee9b1459aad1f (patch) | |
tree | dffbf9d632da064ecc40b8651794565b6653a603 /devel/linux-js/files | |
parent | - Remove some unnecessary patches now that the ports for the libraries (diff) |
Add linux-js.
This port provides a FreeBSD kernel module implementing the Linux joystick
interface (/dev/input/js0), as well as calibration (jscal) and test (jstest)
utilities.
Notes
Notes:
svn path=/head/; revision=155238
Diffstat (limited to 'devel/linux-js/files')
-rw-r--r-- | devel/linux-js/files/jscal.sh.in | 31 |
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" |