Hey yrannadx, one question at first: my app is working for you? So using sim-switcher switches from SIM1 to SIM2 and vice versa? How do you verify your script dows not switch back to SIM1? Do not rely on operator name shown on hildon-home!
#!/bin/sh opcountry=$(dbus-send --system --print-reply=literal --dest=com.nokia.phone.net /com/nokia/phone/net \ Phone.Net.get_registration_status | tr '\n' ' ' | awk '{print $8,$10}') opcode=$(echo $opcountry | cut -f1 -d' ') countrycode=$(echo $opcountry | cut -f2 -d' ') dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net \ Phone.Net.get_operator_name byte:0 uint32:$opcode uint32:$countrycode | grep string \ | awk '{print $2 " " $3}' | tr -d \"
#!/bin/sh # Check no call in progress oncall=`run-standalone.sh dbus-send --system --type=method_call --print-reply=literal --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.GetStatus` if [ $oncall != "uint32 0" ]; then dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"No switch while oncall" uint32:0 string:"OK" return fi # Switch SIM opcode=`run-standalone.sh dbus-send --system --print-reply=literal --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_registration_status | tr '\n' ' ' | awk '{print $8,$10}' | cut -f1 -d' '` # if operator code is from SIM1 switch to SIM2 if [ $opcode == 1 ]; then sim-switcher SIM2 else sim-switcher SIM1 fi