.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

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