Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. MINUTES=${1:-30}
  4.  
  5. future_datetime=$(date -v "+${MINUTES}M")
  6. future_time=$(date -j -f '%a %e %b %Y %H:%M:%S %Z' "${future_datetime}" '+%H:%M:%S')
  7.  
  8. echo "Sleep set to ${future_time}"
  9.  
  10. sudo /usr/bin/pmset repeat sleep MTWRFSU ${future_time}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement