Advertisement
Guest User

Untitled

a guest
Aug 17th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.73 KB | None | 0 0
  1. #!/bin/bash
  2. fun()
  3. {
  4. echo "Script by Sauraedron : Aka Saurabh Wankhade"
  5. con=$(nmcli -t -f state nm status)
  6. if [[ $con != "connected" ]]; then
  7.  
  8.     nmcli -t nm wwan off
  9.         sleep 1
  10.         nmcli -t nm wwan on
  11.         sleep 1
  12.     nmcli -t con up id "Tata Docomo Internet"
  13.     con1=$(nmcli -t -f state nm status)
  14.         if [[ $con1 != "connected" ]]; then
  15.         nmcli -t con down id "Tata Docomo Internet"
  16.         echo "Rescheduling"
  17.         fun
  18.         fi
  19. else
  20.     con=$(nmcli -t -f state nm status)
  21.    
  22. fi
  23. }
  24. fun
  25. while true;
  26. do
  27. echo "Startin Connection Estabilishment procedure"
  28.     if [[ $con == "connected" ]]; then
  29.     sleep 1200
  30.         echo "Reconnecting for safety :)"
  31.         nmcli -t con down id "Tata Docomo Internet"
  32.         fun
  33.     else
  34.        
  35.         echo "bad"
  36.         fun
  37.     fi
  38. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement