Tested on Ubuntu 18.10 and 19.04 .
Not work in Ubuntu 16.04, yet.
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
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'
The project is under GPL v3 (see LICENSE.md)