Home | History | Annotate | Line # | Download | only in rc.d
gpio revision 1.1
      1 #!/bin/sh
      2 #
      3 # $NetBSD: gpio,v 1.1 2009/07/25 16:20:10 mbalmer Exp $
      4 #
      5 
      6 # PROVIDE: gpio
      7 # BEFORE:  securelevel
      8 
      9 $_rc_subr_loaded . /etc/rc.subr
     10 
     11 name="gpio"
     12 rcvar=$name
     13 start_cmd="gpio_start"
     14 stop_cmd=":"
     15 
     16 gpio_start()
     17 {
     18 	if [ -f /etc/gpio.conf ]; then
     19 		echo "Configuring GPIO."
     20 		cat /etc/gpio.conf |
     21 		while read -r args; do
     22 			args=${args%%#*}		# strip comments
     23 			test -z "$args" && continue
     24 			/usr/sbin/gpioctl -q $args
     25 		done
     26 	fi
     27 }
     28 
     29 load_rc_config $name
     30 run_rc_command "$1"
     31