Skip to content

Instantly share code, notes, and snippets.

@otherwiseguy
Created October 12, 2021 15:35
Show Gist options
  • Save otherwiseguy/c69060ae77498fba4670e2c44656aa5c to your computer and use it in GitHub Desktop.
Save otherwiseguy/c69060ae77498fba4670e2c44656aa5c to your computer and use it in GitHub Desktop.
Get a gnome "critical" notification before your devnest reservation expires
#!/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