Last active
October 8, 2015 03:29
-
-
Save sagarrakshe/3270877 to your computer and use it in GitHub Desktop.
Build your own command to connect/disconnect to mobile broadband.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmcli - is a command tool for controlling Network Manager. | |
1. Create a file called Internet-up. | |
2. Copy the following line in it | |
lsusb | (grep -i <string identifying your mobile> &) && (nmcli con up id "<your connection name>" ) && ((ps -el | grep -i firefox ) || firefox &) | |
[eg. lsusb | (grep -i nokia &) && (nmcli con up id "Idea Mobile" ) && ((ps -el | grep -i firefox ) || firefox &)] | |
(Note: ignore '<' but not '"' connection name should be in "qoutes".) | |
3. Using chmod make it executable (chmod 777 all permissions to everyone). | |
4. Now copy the file to one the Shell PATH (you can see the path by executing the command "echo $PATH") or you can add your own path to .bashrc. | |
5. Now just execute it. | |
For Internet-down file everything is same except copy the following line in the file. | |
nmcli con down id "<your connection name>" | |
(Note: This works only when you have connected your mobile through USB and configured it.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment