Christopher Wiley | 2f48d95 | 2013-02-22 09:51:47 -0800 | [diff] [blame] | 1 | #!/bin/dash |
| 2 | |
| 3 | . "$(dirname "$0")/mm.sh" |
| 4 | |
| 5 | cyclegobi () { |
| 6 | local mm=$1 |
| 7 | local modem=$2 |
| 8 | dbus $mm $(iface2rootobj $mm)/$modem $IMODEM_GOBI.PowerCycle |
| 9 | } |
| 10 | |
| 11 | cyclegen () { |
| 12 | local mm=$1 |
| 13 | local modem=$2 |
| 14 | dbus $mm $(iface2rootobj $mm)/$modem $IMODEM.Reset |
| 15 | } |
| 16 | |
| 17 | case $1 in |
| 18 | -a) |
| 19 | for mm in $(modemmanagers); do |
| 20 | for m in $(modems $mm); |
| 21 | do $0 $mm $m |
| 22 | done |
| 23 | done |
| 24 | exit 0 |
| 25 | ;; |
| 26 | esac |
| 27 | |
| 28 | mm=$1 |
| 29 | mmobj=$(iface2rootobj $mm) |
| 30 | mname=$(echo $2 | sed -e "s!$mmobj/!!") |
| 31 | mtype=$(echo $mname | awk -F/ '{print $1}' | tr A-Z a-z) |
| 32 | case $mtype in |
| 33 | gobi) |
| 34 | cyclegobi $mm $mname |
| 35 | ;; |
| 36 | *) |
| 37 | cyclegen $mm $mname |
| 38 | ;; |
| 39 | esac |