Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
I found a tutorial for a adsl connection that creates a startup script and a stop connection script. While the startup script works great the stop script gives errors. Here ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2003
    Location
    Cyprus
    Posts
    96

    Script Error!


    I found a tutorial for a adsl connection that creates a startup script and a stop connection script. While the startup script works great the stop script gives errors. Here are the commands (copied & pasted) from the tutorial:
    Now to create the stop adsl script
    vi stopadsl

    Enter the following information
    #!/bin/sh
    kill -INT `pidof pppd`

    Save and exit file.

    chmod 700 /root/stopadsl

    The error is about the pidof and kill commands. I'm using Red Hat 9. Because i can't shutdown the connection properly i can't connect again because i get a message saying that the modem is already in use so i have to reboot each time in order to reconnect.
    Any ideas???

    Thanks. I am a nOOb so i would appreciate it if you keep it simple
    By the way the tutorial was for setting a Alcatel USB Adsl connection under linux and works great.

  2. #2
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    you could install rp-pppoe and use adsl-start and stop.
    www.roaringpnguin.com/pppoe

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What errors is it that you get?

  4. #4
    Just Joined!
    Join Date
    Jun 2003
    Location
    Cyprus
    Posts
    96
    Well its not exactly an error i kind or remember another script but this is what i get when i run the ./stopadsl script:
    kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l
    [sigspec]

    An because of that when i try to reconnect later i get this:
    Another program/driver is already accessing the modem...

    So i have to reboot all the time to be able to use the modem again!

  5. #5
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    The scripts seems to specifie some wrong flag to the kill-command. Can you paste in the output from the command.

    Code:
    cat stopadsl |grep kill
    So we can see what aregument is passed on to kill.
    Regards

    Andutt

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Could it be that you have used the wrong quotes to encapsulate pidof pppd? Ie. ' instead of `? Try this instead:
    Code:
    kill -INT $(pidof pppd)

  7. #7
    Just Joined!
    Join Date
    Jun 2003
    Location
    Cyprus
    Posts
    96
    This is what i get:
    [root@localhost root]# cat stopadsl |grep kill
    kill -l `pidof pppd`
    [root@localhost root]#

  8. #8
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Edit your script with an texdteditor like emace,vi,pico and change that line to what Dolda pasted in and give it a try again.
    Regards

    Andutt

  9. #9
    Just Joined!
    Join Date
    Jun 2003
    Location
    Cyprus
    Posts
    96
    Well l have to go to work now so i'll give it a try tonight. Thnx!

  10. #10
    Just Joined!
    Join Date
    Jun 2003
    Location
    Cyprus
    Posts
    96
    Well i am sorry to say that this doesn't work either. Here is what i get:
    cd root
    [root@localhost root]# ./stopadsl
    ./stopadsl: line 1: pidof: command not found
    kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
    [root@localhost root]#

    And in case you are wondering:
    [root@localhost root]# cat stopadsl |grep kill
    kill -INT $(pidof pppd)
    [root@localhost root]#

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
  •