Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
/ changeAPTproxyState Public archive

Change the proxy state for APT. Active or deactive proxy definitions in /etc/apt/apt.conf

License

Notifications You must be signed in to change notification settings

Sonic0/changeAPTproxyState

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 

Repository files navigation

changeAPTproxyState

Change the proxy state for APT. It activates or deactivates proxy rules in /etc/apt/apt.conf


Bash Shell Version Open Source Love


Compatibility

Tested on Ubuntu 18.10 and 19.04 .
Not work in Ubuntu 16.04, yet.

Usage

You Must execute ./updateProxy with root privileges

 SYNOPSIS
    ./updateProxy [ -dhv ] [ -i eth0 ] [ -n 192.168.1.0 ] [ -p 80 ] proxyUrl

 OPTIONS
    -i, --interface       This argument will be used to check if interface, in witch the proxy must be activated, is up 
    -n, --network         This argument will be compared with your actual network ip
    -p, --port            Set the port of the Proxy. Default port: 8080
    -d, --debug           Enable debug mode to print more information
    -t, --timelog         Add timestamp to log ("+%y/%m/%d@%H:%M:%S") 
    -h, --help            Print this help
    -v, --version         Print script information

 EXAMPLES
    sudo ${SCRIPT_NAME} proxy.domain.xx
    sudo ${SCRIPT_NAME} -n 10.11.12.0 proxy.domain.xx
    sudo ${SCRIPT_NAME} -i enp2s0 -n 10.11.12.0 proxy.domain.xx
    sudo ${SCRIPT_NAME} -dt proxy.domain.xx

Shortcuts

Beyond manual use, there are some method to simplified the script calls:

  • Create alias in your ~/.bashrc ( ~/.zshrc -> in case of ZSH)

    alias "SHORTCUT_NAME"='sudo bash SCRIPT_PATH/changeAPTproxyState/updateProxy.sh -i enp0s2 10.11.12.0 proxy.domain.sh'

License

The project is under GPL v3 (see LICENSE.md)

About

Change the proxy state for APT. Active or deactive proxy definitions in /etc/apt/apt.conf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages