-
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 :oops: so i would appreciate it if you keep it simple :D
By the way the tutorial was for setting a Alcatel USB Adsl connection under linux and works great.
-
you could install rp-pppoe and use adsl-start and stop.
www.roaringpnguin.com/pppoe
-
What errors is it that you get?
-
Well its not exactly an error i kind or remember another script :oops: 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!
-
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.
-
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)
-
This is what i get:
[root@localhost root]# cat stopadsl |grep kill
kill -l `pidof pppd`
[root@localhost root]#
-
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.
-
Well l have to go to work now so i'll give it a try tonight. Thnx!
-
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]#