#!/bin/sh # set default values ENABLED="yes" ONSTART="no" ONSTOP="yes" # Do radio-reset in the background BACKGROUND="no" if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then exit 0 fi # load the values from /etc/default/radio-reset [ -r /etc/default/radio-reset ] && source /etc/default/radio-reset [[ $BACKGROUND == yes ]] && BG="&" case $1 in start) if [[ $ENABLED == "yes" ]] && [[ $ONSTART == "yes" ]] ; then eval mts-io-sysfs store radio-reset 0 $BG echo "Resetting cellular radio" fi ;; stop) if [[ $ENABLED == "yes" ]] && [[ $ONSTOP == "yes" ]] ; then eval mts-io-sysfs store radio-reset 0 $BG echo "Resetting cellular radio" fi ;; reload) eval mts-io-sysfs store radio-reset 0 $BG ;; *) echo "Usage: $0 {start|stop|reload}" exit 2 ;; esac