-
pppd kill ?
hello,
I have written a small script , the purpose of the script is to
1] start pppd
2] do file transfer through ftp
3] then drop pppd (using pkill pppd)
"pkill pppd" works well on the command prompt ,
but "pkill pppd" doesn't work when included in the script(point 3,
above)
following is the complete script .
please see the comment for the exact problem area
START SCRIPT
#!/bin/sh
HOST='<static ip addr>'
USER='user'
PASSWD='password'
pppd call gprs > /dump &
sleep 20
ftp -in $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
bin
lcd /rpms/outbox/
mput *
quit
pkill pppd.........................(this command is not working)
END_SCRIPT
exit
END SCRIPT
-
Re: pppd kill ?
well the above problem was solved !
the unwanted indention added the bug!
-
Re: pppd kill ?
"vicks" <vikrant.shahir@gmail.com> writes:[color=blue]
> ftp -in $HOST <<END_SCRIPT
> quote USER $USER
> quote PASS $PASSWD
> bin
>
> lcd /rpms/outbox/
> mput *
> quit
> pkill pppd.........................(this command is not working)
> END_SCRIPT[/color]
"pkill" isn't a command understood by /usr/bin/ftp, so sending it to
that command on stdin won't work.
What you probably want is to switch those last two lines -- END_SCRIPT
first (to terminate the ftp standard input here-doc) and then pkill.
--
James Carlson, KISS Network <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
-
Re: pppd kill ?
"vicks" <vikrant.shahir@gmail.com> writes:
[color=blue]
> ftp -in $HOST <<END_SCRIPT
> quote USER $USER
> quote PASS $PASSWD
> bin[/color]
[color=blue]
> lcd /rpms/outbox/
> mput *
> quit
> pkill pppd.........................(this command is not working)
> END_SCRIPT
>exit
> END SCRIPT[/color]
It does not work because you are sending it to the remote machine which you
are ftping to. (actually since you have closed ftp, you are sending it into
the ether) Why should ftp on the remote machine know anything about
pppd . Get that line OUTSIDE the END_SCRIPT.