Results 1 to 10 of 14
Hi,
I am using anaconda + ks.cfg to install Linux.
In my case installation does not require any actions from me and there is no need to sit next to ...
- 07-29-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 8
how to beep at the end of installation
Hi,
I am using anaconda + ks.cfg to install Linux.
In my case installation does not require any actions from me and there is no need to sit next to PC but it takes some time so I would like to hear some loud sound at the end of the process (e.g. something similar to result of echo -e "\a" command) but I cannot find appropriate place in ks.cfg to add thing like this. Can anyone help please?
Thanks
- 07-29-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
If you run this from a script, then you can echo a ^G (hex or octal 7) and it will beep for you. Probably best would be a timed loop that beeps once per second until you press a key.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-29-2010 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 8
Hmmm...
Could you help me to understand where should I add this command to? If I write some script, where/when should I call it? Actually it is the main problem.
Thanks for the reply.
- 07-29-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Here is some C code that will output a beep.
Save it to a file called beep.c and build it like this: make beepCode:#include <stdio.h> int main(void) { printf("\007"); return 0; }
To run it in a script, you will either need to copy it to some directory in your PATH environment, or set your PATH environment to include the directory you created it in. Once you have done that, you can include it in a bash script easily enough. Example:
Code:# run installation script here . . . # now, beep until user breaks script with control-C echo "Installation finished. Press Control-C to finish." while [ "1" == "1" ]; do beep; sleep 1; done
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-30-2010 #5Just Joined!
- Join Date
- Jul 2010
- Posts
- 8
It does not work

ks.cfg
Code:install text skipx ... #------------------------------------ %post --interpreter=/bin/bash #------------------------------------ ... /opt/mydir/beep.sh &
/opt/mydir/beep.sh
/opt/mydir/beep (code)Code:#!/bin/bash echo "Installation finished. Press Control-C to finish." while [ "1" == "1" ]; do /opt/mydir/beep; sleep 1; done
At the end I see the screen "Reboot. Please remove any media used during installation blah blah blah" and silence, there are no any beeps... Did I miss important steps? Did it work for you?#include <stdio.h>
int main(void)
{
printf("\007");
return 0;
}
Thanks!
- 08-03-2010 #6Just Joined!
- Join Date
- Jul 2010
- Posts
- 8
No one can help...
- 08-03-2010 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Sorry. Been (and am) busy - currently teaching 4 days / week + other stuff. I'll try to get back to this some time today after I've finished my class prep.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-03-2010 #8Just Joined!
- Join Date
- May 2008
- Location
- Bangalore, India
- Posts
- 24
that was the c code
/opt/mydir/beep
rename the file to beep.c and compile it
gcc /opt/mydir/beep.c -o /opt/mydir/beep
now call and see
/opt/mydir/beep
if it beeps it will beep there too
- 08-04-2010 #9Just Joined!
- Join Date
- Jul 2010
- Posts
- 8
Sanjeevt, my /opt/mydir/beep is *compiled* c-code and it beeps if I run it manually, /opt/mydir/beep.sh causes a lot of beeps if I run it manually... but there are no beeps at the end of installation.
Rubberman, thanks a lot for your help!
- 08-04-2010 #10Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
The problem may be if the installation is run as a background process or unattached to a tty. The beep program I provided expects to be running on a tty or console that can output the beep. When you run in background or redirect stdout, the beep won't be heard. Since you are running beep.sh as a background process with the &, this is to be expected. Try running it as a foreground process, or redirect the output to the console or running tty.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
