Created
October 12, 2021 15:35
-
-
Save otherwiseguy/c69060ae77498fba4670e2c44656aa5c to your computer and use it in GitHub Desktop.
Get a gnome "critical" notification before your devnest reservation expires
This file contains 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
#!/bin/bash | |
WARN_HOURS=72 | |
while getopts ":t:" opt; do | |
case ${opt} in | |
t) | |
timeout=$OPTARG | |
;; | |
esac | |
done | |
if devnest reserve $@; then | |
warn=$((timeout-${WARN_HOURS})) | |
if [ ${warn} > 0 ]; then | |
echo "notify-send -u critical WARNING 'devnest box ${!#} expires in $WARN_HOURS'"| at -v now + ${warn} hours | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment