Add keep_alive func
This commit is contained in:
parent
2bc913011f
commit
ccd1a8c740
|
@ -19,4 +19,11 @@ function do_link {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ask for admin password up front and keep sudo alive until the end of the script
|
||||||
|
function keep_alive {
|
||||||
|
sudo -v
|
||||||
|
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# vim:set ft=zsh:
|
# vim:set ft=zsh:
|
||||||
|
|
Loading…
Reference in a new issue