Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    abr
    abr is offline
    Just 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

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    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!

  3. #3
    abr
    abr is offline
    Just 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.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Quote Originally Posted by abr View Post
    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.
    Here is some C code that will output a beep.
    Code:
    #include <stdio.h>
    int main(void)
    {
        printf("\007");
        return 0;
    }
    Save it to a file called beep.c and build it like this: make beep
    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!

  6. #5
    abr
    abr is offline
    Just 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
    Code:
    #!/bin/bash
    
    echo "Installation finished. Press Control-C to finish."
    while [ "1" == "1" ]; do /opt/mydir/beep; sleep 1; done
    /opt/mydir/beep (code)
    #include <stdio.h>
    int main(void)
    {
    printf("\007");
    return 0;
    }
    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?

    Thanks!

  7. #6
    abr
    abr is offline
    Just Joined!
    Join Date
    Jul 2010
    Posts
    8

    Unhappy

    No one can help...

  8. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    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!

  9. #8
    Just 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

  10. #9
    abr
    abr is offline
    Just 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!

  11. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    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!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •