#!/bin/sh
# Copyright 2011 Paul Parsons
# Distributed under the terms of the GNU General Public License v3 or later

depend="base"
service --depend ${depend} || exit 1

case $1 in
"start")
	keypressed /dev/input/gpio-keys RECORD || exit 0
	modprobe g_serial use_acm=no
	sleep 1
	daemon --start --label=$0 /sbin/begetty ttyGS0
	;;
"stop")
	lsmod | fgrep -q g_serial || exit 0
	daemon --stop --label=$0
	rmmod g_serial
	;;
esac

exit 0
