diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index 6a8a330..ce32082 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -229,7 +229,8 @@ mainloop() { while read -r line; do if echo "$line" | grep -E "^signal.*StateChanged"; then rm /tmp/modem.*.state 2>/dev/null - read -r oldstate + # shellcheck disable=SC2034 + read -r oldstate #unused but we need to read past it read -r newstate if echo "$newstate" | grep "int32 2"; then touch /tmp/modem.locked.state diff --git a/scripts/modem/sxmo_unlocksim.sh b/scripts/modem/sxmo_unlocksim.sh index 3f04b07..36d8d98 100755 --- a/scripts/modem/sxmo_unlocksim.sh +++ b/scripts/modem/sxmo_unlocksim.sh @@ -11,7 +11,7 @@ modem_n() { } sim_n() { - SIMS="$(mmcli -m $(modem_n) | grep SIM)" + SIMS="$(mmcli -m "$(modem_n)" | grep SIM)" echo "$SIMS" | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2 return } @@ -23,11 +23,12 @@ else pkill dmenu #kill existing dmenu while [ $retry -eq 1 ]; do PICKED="$( + # shellcheck disable=SC2039 echo -e "Cancel\n0000\n1234" | sxmo_dmenu_with_kb.sh -l 3 -c -p "PIN:" | tr -d "\n\r " )" if [ -n "$PICKED" ] && [ "$PICKED" != "Cancel" ]; then retry=0 - mmcli -i $(sim_n) --pin "$PICKED" > /tmp/unlockmsg 2>&1 || retry=1 + mmcli -i "$(sim_n)" --pin "$PICKED" > /tmp/unlockmsg 2>&1 || retry=1 MSG=$(cat /tmp/unlockmsg) [ -n "$MSG" ] && notify-send "$MSG" if echo "$MSG" | grep -q "not SIM-PIN locked"; then