Script to add proxy environments for commands.
Go to file
2023-09-18 10:28:36 +08:00
.gitignore Add PKGBUILD for packaging for archlinux, add gitignore 2023-09-14 12:31:04 +08:00
LICENSE Add License 2023-09-14 12:33:08 +08:00
PKGBUILD Add License 2023-09-14 12:33:08 +08:00
proxyenv Fix: syntax error when comparing number of arguments 2023-09-18 10:28:36 +08:00
proxyenv.conf Finish the logic 2023-09-14 11:47:43 +08:00
README.md Modify README 2023-09-17 22:09:12 +08:00

proxyenv

This program is designed to be used like proxychains, that is

proxyenv <any program> <any arguments for the program>

This program used to be a simple bash function, firsted introduced at A shell function to set environemt for any single command (Title has been translated).

It works most of the time, but when using other command wrappers like sudo proxyenv cmd, the shell function will not work anymore, because in the context of sudo, the function proxyenv is inaccessible.

So I make it as an bash script, which still accessible inside any other program wrappers, that's this program.

Usage

proxyenv <any program> <any arguments>

Configuration

If environemt PROXYENV_CONFPATH is set, the program will use the path indicted by it to read the proxy actually to be used. Otherwise /etc/proxyenv.conf will be used.

The configuration file (default /etc/proxyenv.conf) will be sourced when proxyenv run, so take care no let this file's permission to open, 755 is suggested.

For entry detail of configuration file, see proxyenv.conf in this repository.

Misc

Which version to use

Althought there are tags, using the code on branch main is always suggested. The tag was added just to let git describe happy, which used in PKGBUILD

Install on Archlinux

Since I add a PKGBUILD at the root of repository, you can use the following command to build and install this program on Archlinux.

makepkg
pacman -U <generated package>