Refreshes sudo session for shell scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cli dc974e0feb Initial commit 2 months ago
.gitignore Initial commit 2 months ago
CHANGELOG.md Initial commit 2 months ago
LICENSE.md Initial commit 2 months ago
README.md Initial commit 2 months ago
sudoloop Initial commit 2 months ago

README.md

sudoloop

sudoloop is intended for long-running scripts which run as one user but occasionally use sudo to perform actions as another user. This works by calling sudo --validate in a loop to keep the sudo session alive while the script is running. For maximum portability, sudoloop is written to work on any POSIX shell.

The simplest usage simply involves wrapping the command in sudoloop:

sudoloop command [arg]...

Although the SUDO_LOOP_TIME environment variable can be used to change the amount of time spent between sudo --validate calls, in case the default time of 60 seconds is too short. The SUDO_LOOP_TIME variable can take any string that is a valid argument to the sleep command, which defaults to seconds:

env SUDO_LOOP_TIME=30 sudoloop command [arg]...

License

Available under the public domain via the CC0 Universal License.