Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
beep scripts & reboot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Corpse2
n00b
n00b


Joined: 14 Jan 2004
Posts: 60

PostPosted: Wed Jul 28, 2004 12:00 pm    Post subject: beep scripts & reboot Reply with quote

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 :oops:

i was thinking of just printing ascii character 7, but then again, I know nothing about scripting.

Any ideas?
Back to top
View user's profile Send private message
b-llwyd
Guru
Guru


Joined: 24 Jul 2002
Posts: 302
Location: Uppsala, Sweden

PostPosted: Wed Jul 28, 2004 12:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
b-llwyd
Guru
Guru


Joined: 24 Jul 2002
Posts: 302
Location: Uppsala, Sweden

PostPosted: Wed Jul 28, 2004 12:35 pm    Post subject: Reply with quote

...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
View user's profile Send private message
Corpse2
n00b
n00b


Joined: 14 Jan 2004
Posts: 60

PostPosted: Wed Jul 28, 2004 3:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Corpse2
n00b
n00b


Joined: 14 Jan 2004
Posts: 60

PostPosted: Wed Jul 28, 2004 4:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
b-llwyd
Guru
Guru


Joined: 24 Jul 2002
Posts: 302
Location: Uppsala, Sweden

PostPosted: Wed Jul 28, 2004 6:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Corpse2
n00b
n00b


Joined: 14 Jan 2004
Posts: 60

PostPosted: Wed Jul 28, 2004 8:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
b-llwyd
Guru
Guru


Joined: 24 Jul 2002
Posts: 302
Location: Uppsala, Sweden

PostPosted: Wed Jul 28, 2004 9:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Thu Jul 29, 2004 8:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Corpse2
n00b
n00b


Joined: 14 Jan 2004
Posts: 60

PostPosted: Thu Jul 29, 2004 10:57 am    Post subject: Reply with quote

interesting, I'll have a look.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum