LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Terminal Shutdown -h -P with a beep? (http://www.linuxquestions.org/questions/linux-general-1/terminal-shutdown-h-p-with-a-beep-842037/)

Amdx2_x64 11-02-2010 11:34 PM

Terminal Shutdown -h -P with a beep?
 
I have a habit of watching videos when I go to sleep. So I decided to start using, for example, the following when I laid down:

sudo shutdown -h -P 60

Of course this shuts down the computer in an hour. I was wondering if there was a way I could get the computer to beep a few times for the last 10 Minutes and then a few more times for the last 5 minutes?

neonsignal 11-03-2010 01:21 AM

You could use a script (run in the background):
Code:

#!/bin/sh
sleep 50m
printf '\a'; sleep 1; printf '\a'; sleep 1; printf '\a'
sleep 5m
printf '\a'; sleep 1; printf '\a'; sleep 1; printf '\a'
sleep 5m
sudo shutdown -h -P now


Amdx2_x64 11-03-2010 01:42 AM

Great. Thanks. I will give that a try tonight and let you know how it goes.

Amdx2_x64 11-03-2010 12:59 PM

Well I forgot to do this last night. However I did install the program beep. I forgot this and started falling asleep watching a movie and I did the sudo shutdown -h -P 120 Well the movie ended and the speakers where loud and it BEEPED. Good that it does it now, bad that I think they heard it several blocks away.


All times are GMT -5. The time now is 09:07 PM.