summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/radio-reset.init
blob: f469df42713048609e527c3072d8f7156639ab82 (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
#!/bin/sh

ENABLED="yes"

if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then
    exit 0
fi
[ -r /etc/default/radio-reset ] && source /etc/default/radio-reset

case $1 in
  start)
    if [[ $ENABLED == "yes" ]] && [[ $START == "yes" ]] ; then
	mts-io-sysfs store radio-reset 0
        echo "Resetting cellular radio"
    fi
    ;;
  stop)
    if [[ $ENABLED == "yes" ]] && [[ $STOP == "yes" ]] ; then
	mts-io-sysfs store radio-reset 0
        echo "Resetting cellular radio"
    fi
    ;;
  reload)
    mts-io-sysfs store radio-reset 0
    ;;
  *)
    echo "Usage: $0 {start|stop|reload}"
    exit 2
    ;;
esac