Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Bash / Shell Scripting (http://www.programmingforums.org/forum26.html)
-   -   My Dial script.. sort of (http://www.programmingforums.org/showthread.php?t=10)

zdawg Apr 7th, 2004 7:04 PM

Sup all

This is my first shell script, I'm fairly lost. It does what I want it to..
drops eth0, dials, starts my firewall script, saves to iptables and checks ifconfig. Though I have to listen for the dialing to finish, then press ENTER. But so far that's the only way I know how to do it. I'd rather have it verify that ppp0 is up then execute the rest, but that's beyond me yet. Here it is:

:

#!/bin/sh
#zdawgs script to stop/start eth0 and dialout
IFCONFIG=/usr/sbin/ifconfig

ifconfig eth0 down && pon
echo; echo "Down eth0... dialing..."
echo "Press ENTER when dial ready."
read ready




ifconfig eth0 up && zwall && iptables-save && ifconfig
exit 0


big_k105 Apr 14th, 2004 11:31 PM

sorry i cant help you out, im not very strong on my shell scripting sorry. maybe someone else will beable to help. or if you figure it out let us know what you had to do to fix it :)

lordnothing May 3rd, 2004 7:05 PM

try adding an if....fi statement to it that includes the following:
:

ifconfig|grep ppp0

Infinite Recursion Jul 15th, 2004 4:36 PM

You could also try using a sleep command to wait for a specific interval to
allow the process to finish.

IR


All times are GMT -5. The time now is 4:22 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC