Last active
March 15, 2022 17:09
-
-
Save frullah/0a98a84d5a0b4617e943589e23de019e to your computer and use it in GitHub Desktop.
shutdown until process finishes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shutdown until process finishes | |
# | |
## arguments | |
# first argument is a PID | |
pid=$1 | |
while true | |
do | |
if ! ps -p $pid > /dev/null | |
then | |
sudo shutdown -h now | |
fi | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment