1
1
Fork
You've already forked sudoloop
0
Refreshes sudo session for shell scripts
  • Shell 100%
2026年07月08日 12:24:58 -04:00
LICENSES Initial commit 2026年05月19日 16:14:23 -04:00
.editorconfig Initial commit 2026年05月19日 16:14:23 -04:00
.gitignore fix exit code 2026年07月08日 12:24:58 -04:00
CHANGELOG.md fix exit code 2026年07月08日 12:24:58 -04:00
LICENSE.md Initial commit 2026年05月19日 16:14:23 -04:00
PKGBUILD fix exit code 2026年07月08日 12:24:58 -04:00
README.md Initial commit 2026年05月19日 16:14:23 -04:00
REUSE.toml Initial commit 2026年05月19日 16:14:23 -04:00
sudoloop fix exit code 2026年07月08日 12:24:58 -04:00

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]...

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

Released to the public domain to the greatest extent possible via the CC0 License.