NetBSD/etc/rc.d/gpio
mbalmer 70d654f756 Document recent gpio(4) changes and introduce a new config file for GPIO.
Integrate with the startup scripts in /etc/rc.d.  Introduce new variable
"gpio" for /etc/rc.conf.
2009-07-25 16:20:10 +00:00

31 lines
481 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: gpio,v 1.1 2009/07/25 16:20:10 mbalmer Exp $
#
# PROVIDE: gpio
# BEFORE: securelevel
$_rc_subr_loaded . /etc/rc.subr
name="gpio"
rcvar=$name
start_cmd="gpio_start"
stop_cmd=":"
gpio_start()
{
if [ -f /etc/gpio.conf ]; then
echo "Configuring GPIO."
cat /etc/gpio.conf |
while read -r args; do
args=${args%%#*} # strip comments
test -z "$args" && continue
/usr/sbin/gpioctl -q $args
done
fi
}
load_rc_config $name
run_rc_command "$1"