aquaballoon

uptime -sh

Jul 8th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. upSeconds="$(cat /proc/uptime | grep -o '^[0-9]\+')"
  4. upMins=$((${upSeconds} / 60))
  5.  
  6. if [ "${upMins}" -gt "5" ]
  7. then
  8.  zenity --warning --text "Your session time is about to expire! You have 300 sec. to save your work and logout."
  9.  killall firefox // kill -9 -1 // reboot
  10. #    echo "Up for ${upMins} minutes"
  11. #else
  12. #    echo "Up five minutes or less"
  13. fi
Advertisement
Add Comment
Please, Sign In to add comment