View previous topic :: View next topic |
Author |
Message |
Corpse2 n00b
Joined: 14 Jan 2004 Posts: 60
|
Posted: Wed Jul 28, 2004 12:00 pm Post subject: beep scripts & reboot |
|
|
My gentoo server is sitting in the closet without screen and mouse.
1) I would like him to beep a few times when he is finished booting en when doing a reboot. For example twice when booted, and 3 times when going to reboot.
2) Also, in case I cannot connect to it anymore with ssh, I would like to be able to reboot it by pressing for example: "ctrl-alt-<something>"
How can I do this? I'm kinda noob in scripting
i was thinking of just printing ascii character 7, but then again, I know nothing about scripting.
Any ideas? |
|
Back to top |
|
|
b-llwyd Guru
Joined: 24 Jul 2002 Posts: 302 Location: Uppsala, Sweden
|
Posted: Wed Jul 28, 2004 12:31 pm Post subject: |
|
|
I can't seem to be able to make this work on my machine, but try these for beepers:
Code: | echo -e \a
echo -e "\a"
echo $'\a'
echo -ne \\a
|
|
|
Back to top |
|
|
b-llwyd Guru
Joined: 24 Jul 2002 Posts: 302 Location: Uppsala, Sweden
|
Posted: Wed Jul 28, 2004 12:35 pm Post subject: |
|
|
...and about the reboot ctrl-alt-* issue, if you look in your /etc/inittab you will see:
Code: | # What to do at the "Three Finger Salute".
ca:12345:ctrlaltdel:/sbin/shutdown -r now
|
which seems to say a simple ctrl-alt-del will reboot the machine. I know it works for me...sometimes at least |
|
Back to top |
|
|
Corpse2 n00b
Joined: 14 Jan 2004 Posts: 60
|
Posted: Wed Jul 28, 2004 3:35 pm Post subject: |
|
|
indeed, the ctrl-alt-del thing was something I should have known and it was already there.
But the four beep commands don't seem to work. Allthough when I ssh to my gentoo from Windows with putty, it does give me the "default beep" sound from windows for al but the first commands.
This is the same when typing alt+07.
Should I have to enable my speaker somehow? |
|
Back to top |
|
|
Corpse2 n00b
Joined: 14 Jan 2004 Posts: 60
|
Posted: Wed Jul 28, 2004 4:06 pm Post subject: |
|
|
found in another thread that the speaker has to be compiled in the kernel or as module:
Device Drivers >>input device support >> misc input device support -> misc
and now it beeps with these commands:
Code: | echo -e "\a"
echo $'\a'
echo -ne \\a |
But when I do Code: | echo -ne \\a && echo -ne \\a | it only beeps once, not twice.
How can I put a delay between them? |
|
Back to top |
|
|
b-llwyd Guru
Joined: 24 Jul 2002 Posts: 302 Location: Uppsala, Sweden
|
Posted: Wed Jul 28, 2004 6:23 pm Post subject: |
|
|
maybe something like:
echo -ne \\a; sleep 1; echo -ne \\a
(man sleep)
sleep n, sleeps for n seconds (can be decimal, sleep 0.4) |
|
Back to top |
|
|
Corpse2 n00b
Joined: 14 Jan 2004 Posts: 60
|
Posted: Wed Jul 28, 2004 8:52 pm Post subject: |
|
|
thanks,
I put Code: | echo -ne \\a && sleep 0.2 && echo -ne \\a |
/etc/conf.d/local.stop and /etc/conf.d/local.start and it does exactly what I wanted. |
|
Back to top |
|
|
b-llwyd Guru
Joined: 24 Jul 2002 Posts: 302 Location: Uppsala, Sweden
|
Posted: Wed Jul 28, 2004 9:18 pm Post subject: |
|
|
Great Hmm...I might do something like that myself, as I have a distcc/movie computer in the closet. <pondering-the-use> |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Thu Jul 29, 2004 8:19 am Post subject: |
|
|
For beeps you should emerge beep, it lets you control how many beeps, the frequency, duration, time in between beeps. Pretty much everything you'd want to do with a beep. _________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
Corpse2 n00b
Joined: 14 Jan 2004 Posts: 60
|
Posted: Thu Jul 29, 2004 10:57 am Post subject: |
|
|
interesting, I'll have a look. |
|
Back to top |
|
|
|