aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/zaurusd.in
blob: ad896aac7517be541d709bbe33e319a8900f0f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

killproc() {            # kill the named process(es)
        pid=`/bin/ps -e x |
             /bin/grep $1 |
             /bin/grep -v grep |
             /bin/sed -e 's/^  *//' -e 's/ .*//'`
        [ "$pid" != "" ] && kill $pid
}

. @appconfdir@/config

case "$1" in
    start)
    	echo "Starting Zaurusd"

	if [ "x$HAVE_ALSA_MIXER" != "x" ]; then
	    @sbindir@/alsactl restore
	fi

    	if [ "x$HAVE_INPUT_SWITCHES" != "x" -a -x @bindir@/switchevd ]; then
    	    @bindir@/switchevd $SWITCH_EVENT_DEVICE &
    	fi

    	if [ "x$HAVE_TSKEYS" != "x" -a -x @bindir@/tskeys ]; then
    	    modprobe uinput	
            if [ -x @bindir@/setleds ]; then
	        @bindir@/setleds +num < /dev/tty0
	    fi
	    if [ -e @sysconfdir@/profile.d/tslib.sh ]; then
	        . @sysconfdir@/profile.d/tslib.sh
	    fi
    	    if [ -e @sysconfdir@/pointercal ]; then
    	    	@bindir@/tskeys $TSKEYS_CONF $TSKEYS_DEVICE &
    	    fi
    	fi
    ;;

    stop)
        echo "Stopping Zaurusd"
	if [ -x @bindir@/switchevd ]; then
            killproc @bindir@/switchevd
	fi
	if [ -x @bindir@/tskeys ]; then
            killproc @bindir@/tskeys
	fi
	if [ "x$HAVE_ALSA_MIXER" != "x" ]; then
	    @sbindir@/alsactl store
	fi
    ;;

    restart)
    	$0 stop
    	sleep 1
    	$0 start
    ;;

    *)
        echo "usage: $0 { start | stop }"
    	exit 1
    ;;
esac

exit 0