Fix for when modem is hotplugged

This commit is contained in:
jacob.eva 2023-09-16 14:56:06 +01:00
parent f226f0b14e
commit 2daba173f0
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
1 changed files with 3 additions and 1 deletions

View File

@ -1 +1,3 @@
nmcli -t -f active,ssid dev wifi | grep -E 'yes' | cut -c 5- | grep . || (mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep "operator name:" | cut -c 38- | tr -d '\n' && echo -n ": " && mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep -P "\d+%" -o) || echo "Disconnected"
modem=$(mmcli -L | grep -P "/org/freedesktop/.+\d" -m 1 -o)
nmcli -t -f active,ssid dev wifi | grep -E 'yes' | cut -c 5- | grep . || (mmcli -m $modem | grep "operator name:" | cut -c 38- | tr -d '\n' && mmcli -m $modem | grep -P " \d+%" -o) || echo "Disconnected"