Почему обновление с LTS до версии X.10 [дубликат]

У меня тоже была очень похожая проблема. Мой интернет настолько шепот, что когда есть колебания мощности, модем отключается и не может быть замечен, если вы не потянете модем и не включите его снова. В противном случае вы можете использовать usb_modeswitch. Таким образом, я взял вышеупомянутый скрипт и подстроил его для выполнения обеих задач.

#!/bin/bash

while true; do
#Anything less than a solid connection reboots the USB modem
LC_ALL=C nmcli -t -f TYPE,STATE dev | grep -q "^cdma:connected$"
if [ ! $? -eq 0 ]; then

#Reset USB Modem (12d1:1001 will have to be changed to match your modem)
sudo usb_modeswitch -R -v 12d1 -p 1001
#Wait 20 Seconds before trying to bring up the Broadband connections
sleep 20
    nmcli -t nm wwan on
#Wait Another 20 Seconds then test if the connection came up on its own as it is set to auto-connect
    sleep 20
LC_ALL=C nmcli -t -f TYPE,STATE dev | grep -q "^cdma:disconnected$"
if [ $? -eq 0 ]; then        
    nmcli -t con up id "Zantel connection"
    sleep 15
fi
    #wait approximately 15 sec to get connected

fi
#it does not worth keep it checking every millisecond.
#my connection will be reestablished within 5-15 seconds
sleep 2
#if anyone can code it better please feel free to comment
#TO-DO:: check for data received. if data < 15 KB after 20 seconds of connection
#reconnect mobile broadband connection  
done

Спасибо!

1
задан 13 April 2017 в 15:25

0 ответов

Другие вопросы по тегам:

Похожие вопросы: