.bashrc: add sudoloop alias
This commit is contained in:
parent
0f4b0525e9
commit
b33f7bd2fa
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue