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,579
Trophies
2
Location
duel acadamia
XP
5,869
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,372
Trophies
4
Location
Space
XP
13,973
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
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    Thanks for signing up at LinusTechTips
  • QuarterCut @ QuarterCut:
    holey shmoley!
  • BigOnYa @ BigOnYa:
    Your credit card has been charged. Thank you.
  • K3Nv2 @ K3Nv2:
    Your screwdriverPlus will arrive in three weeks
    +1
  • QuarterCut @ QuarterCut:
    K64_Waddle_Dee_Artwork_1.jpg

    my reaction to such information
    +2
  • BigOnYa @ BigOnYa:
    Press 1 for English. Press 2 for Pig Latin. Or press 3 to speak to a representative.
  • BakerMan @ BakerMan:
    guys, i need help, i got into an argument about what genre radioactive is, and i forgot who made it
  • Sicklyboy @ Sicklyboy:
    @BakerMan, Imagine Dragons
  • Sicklyboy @ Sicklyboy:
    Dragon deez nuts across yo face GOTEEM
  • Sicklyboy @ Sicklyboy:
    lmao now I realize that was probably the joke in the first place
    +1
  • BakerMan @ BakerMan:
    IMAGINE DRAGON DEEZ NUTS ACROSS YO- FUCK HE BEAT ME TO IT
  • BigOnYa @ BigOnYa:
    You have selected 4 - Death by Snu Snu, please stand by...
    +1
  • BakerMan @ BakerMan:
    lucky bastard
    +1
  • Sicklyboy @ Sicklyboy:
    hahahaha I'm half way through a bag off my Volcano and my tolerance is way down because I haven't been smoking much lately, so I was a little slow to catch that that was what your angle was 🤣🤣
    +1
  • Sicklyboy @ Sicklyboy:
    Also I was just excited to know a music reference for once (I am the LAST person in the world that you want on your trivia team)
    +2
  • K3Nv2 @ K3Nv2:
    Bummer webos 7.4 isnt working with dejavuln-autoroot
  • Sicklyboy @ Sicklyboy:
    PS4 right? I think that's what mine's on. Or 5.6, maybe.
  • K3Nv2 @ K3Nv2:
    [!] Installation failed (devmode_enabled not recognized)
  • K3Nv2 @ K3Nv2:
    0.5 seemed to work whatever lol i wont bitch
  • Alysh_Graham @ Alysh_Graham:
    Hehehe
    Alysh_Graham @ Alysh_Graham: Hehehe