.bashrc: add sudoloop alias

This commit is contained in:
Lexi / Zoe 2021-05-31 14:23:33 +02:00
parent 0f4b0525e9
commit b33f7bd2fa
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
1 changed files with 11 additions and 0 deletions

View File

@ -81,6 +81,17 @@ function dumpargs() {
done done
} }
# Loop sudo to avoid entering password again
function sudoloop() {
# Run once in foreground to enter password
sudo -v || return 1
# Run loop in background
{ while true; do
sudo -v || return 1
sleep 60
done } &
}
# Shortcuts to encode/decode strings with base64 # Shortcuts to encode/decode strings with base64
function b64enc() { function b64enc() {
echo -n "$1" | base64 -w 0 echo -n "$1" | base64 -w 0