blob: 1a93519e36a4b56bb3e0a4f02d67a81ee5420dc9 [file] [log] [blame]
Christopher Wiley2f48d952013-02-22 09:51:47 -08001#!/bin/dash
2
3. "$(dirname "$0")/mm.sh"
4
5cyclegobi () {
6 local mm=$1
7 local modem=$2
8 dbus $mm $(iface2rootobj $mm)/$modem $IMODEM_GOBI.PowerCycle
9}
10
11cyclegen () {
12 local mm=$1
13 local modem=$2
14 dbus $mm $(iface2rootobj $mm)/$modem $IMODEM.Reset
15}
16
17case $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 ;;
26esac
27
28mm=$1
29mmobj=$(iface2rootobj $mm)
30mname=$(echo $2 | sed -e "s!$mmobj/!!")
31mtype=$(echo $mname | awk -F/ '{print $1}' | tr A-Z a-z)
32case $mtype in
33 gobi)
34 cyclegobi $mm $mname
35 ;;
36 *)
37 cyclegen $mm $mname
38 ;;
39esac