daily pastebin goal
14%
SHARE
TWEET

Rudy

a guest Feb 12th, 2010 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ $# -ne 1 ]
  4. then
  5.   echo "Usage: `basename $0` (seconds)"
  6.   exit 65;
  7. fi
  8.  
  9. if [[ $1 =~ ^[0-9]+$ ]]; then
  10.   CNT=$1
  11.   while [ $CNT -gt 0 ]; do
  12.     printf "Sleeping in $CNT seconds (press Ctrl-C to abort)... \r"
  13.     let CNT=CNT-1
  14.     sleep 1
  15.   done
  16.   printf "\r\n";
  17.   xset dpms force off
  18.   exit 0
  19. else
  20.   echo "Usage: `basename $0` (seconds)"
  21.   exit 1;
  22. fi
RAW Paste Data
Top