Skip to content

Instantly share code, notes, and snippets.

@tushar-borole
Forked from kimar/do-bandwidth-shutdown
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save tushar-borole/83e0d9d2204f86eb0849 to your computer and use it in GitHub Desktop.

Select an option

Save tushar-borole/83e0d9d2204f86eb0849 to your computer and use it in GitHub Desktop.
#!/bin/bash
ax=`vnstat --oneline | awk -F ";" '{print $11}'`
if [[ "$ax" == *GiB* ]];
then
if [ $(echo "$(echo "$ax" | sed 's/ GiB//g') > 999"|bc) -eq 1 ]
then
shutdown -h now
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment