Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. export START_H=`date +%H`
  2. export START_M=`date +%m`
  3.  
  4. CURRENT_H=`date +%H`
  5. CURRENT_M=`date +%M`
  6. TIME=`expr $CURRENT_H - $START_H`
  7.  
  8. if [ $TIME -gt 0 ] && [ $START_M -lt $CURRENT_M ]; then
  9. echo "boot time is more than an hour"
  10. fi
  11.  
  12. export BOOT_TIME=$(date +%s)
  13. current=$(date +%s)
  14. (( current - BOOT_TIME >3600 )) && echo "More than an hour"
  15.  
  16. if [ $TIME -gt 0 ] && [ $START_M -lt $CURRENT_M ]; then
  17. echo "boot time is more than an hour"
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement