ways to disable/enable a few lines in .bashrc/sudoers? (script)

chrisrlink

Has a PhD in dueling
OP
Member
Joined
Aug 27, 2009
Messages
5,561
Trophies
2
Location
duel acadamia
XP
5,742
Country
United States
hi so i need an on the fly script to turn on/off a few lines so pdanet (an android app that uses hotspot and hides tether usage) to make it work on linux

video on how it's done


so in a nutshell I must add 2 lines one to .bashrc and one using visudo for the /etc/sudoers file

for .bashrc

export https_proxy=192.168.49.1:8000

for sudoers

Defaults env_keep += "https_proxy"

and exec source .bashrc command
I just need a bash script to comment out/in those 2 lines just on a double click, or learn how to do it any help would be nice, thanks for whoever helps me
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,296
Trophies
4
Location
Space
XP
13,861
Country
Norway
hi so i need an on the fly script to turn on/off a few lines so pdanet (an android app that uses hotspot and hides tether usage) to make it work on linux

video on how it's done


so in a nutshell I must add 2 lines one to .bashrc and one using visudo for the /etc/sudoers file

for .bashrc

export https_proxy=192.168.49.1:8000

for sudoers

Defaults env_keep += "https_proxy"

and exec source .bashrc command
I just need a bash script to comment out/in those 2 lines just on a double click, or learn how to do it any help would be nice, thanks for whoever helps me

You can probably keep the /etc/sudoers line there permanently, since it won't have any effect without the other line. As for the .bashrc line, there is no reason you can't put this line directly in a bash script instead of in .bashrc. It's just a normal bash command. Although it might only have an effect in the same terminal window you run the command in. And use "unset https_proxy" to "disable" it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Purple_Heart @ Purple_Heart: ye