Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export START_H=`date +%H`
- export START_M=`date +%m`
- CURRENT_H=`date +%H`
- CURRENT_M=`date +%M`
- TIME=`expr $CURRENT_H - $START_H`
- if [ $TIME -gt 0 ] && [ $START_M -lt $CURRENT_M ]; then
- echo "boot time is more than an hour"
- fi
- export BOOT_TIME=$(date +%s)
- current=$(date +%s)
- (( current - BOOT_TIME >3600 )) && echo "More than an hour"
- if [ $TIME -gt 0 ] && [ $START_M -lt $CURRENT_M ]; then
- echo "boot time is more than an hour"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement