Re: newbie: need inspiration

From: Daniel W. (daw..._at_aon.at)
Date: 08/28/05

  • Next message: John Kelly: "rm delete hidden files"
    Date: Sun, 28 Aug 2005 02:58:28 +0200
    
    

    Daniel W. wrote:
    > hello,
    > [....]

    thanks for your support.

    I've hacked this simple script.
    I know it isn't very efficient but as I said I'm a newbie in shell
    programming.

    Does anybody knows a good online-tutorial? The most I've found
    are incomplete. I haven't found how to break more than one loop and
    similar things.
    But I'm happy with this working script.

    greetings,
    daniel

    #!/bin/bash

    bEnd=0

    /usr/sbin/speedmgmt &

    printf "initialize modem and waiting as long as the modem is ready...\n"

    while true
    do
         tail /var/log/messages > goonline.tmp

         grep "Modem initialised" goonline.tmp > /dev/null
         if expr $? '=' 0 > /dev/null; then
             break
         fi

         sleep 1
         printf "."
    done

    printf "\n"
    printf "modem seems to be ready, go on\n"

    while true
    do
         printf "dialing...\n"
         pppd call aon > /dev/null

         while true
         do
             tail /var/log/messages > goonline.tmp
             grep "remote IP address" goonline.tmp
             if expr $? '=' 0 > /dev/null; then
                 bEnd=1
                 break
             fi

             sleep 1
             printf "$i \r"
             let i=$i+1

             if (test $i -gt 8)
             then
                 break
             fi
         done

         if (test $bEnd -eq 1)
         then
             break
         fi

         i=0
         printf "ERROR, call again\n"
    done

    printf "you are online\n"


  • Next message: John Kelly: "rm delete hidden files"

    Relevant Pages

    • lk-changelog.pl 0.213
      ... This script is used by Linus and Marcelo to rearrange and reformat BK ... +'berentsen:sent5.uni-duisburg.de' => 'Martin Berentsen', ... 'daniel.ritz:ch.rmk.(none)' => 'Daniel Ritz', ...
      (Linux-Kernel)
    • Re: Looking for file transfer tool with XMODEM on Linux
      ... >> (the modem init string may be different, ... >> But if I reboot the local linux box and try to use Floyd's script ... Something to initialize the serial port. ...
      (comp.os.linux.misc)
    • Re: Modem on Linux box acting as home router/firewall
      ... modem connection. ... The graphical interface does nothing that the command line cannot do. ... where ppp-on is a script which sets up ppp on the machine or sets up mgetty ... use demand dialing and the idle option to pppd.\ ...
      (comp.os.linux.setup)
    • problem with readline
      ... I have a script that queries a database, grabs a bunch of email addresses from ... push @email_list, $address; ...
      (perl.beginners)
    • Re: PPP Slack 9.1 kernel 2.4.18
      ... Make sure you are NOT attempting to look for a login or username prompt. ... The 'chat' script used to control the modem should set one or two error ...
      (comp.os.linux.questions)