Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 7th, 2004, 7:04 PM   #1
zdawg
Newbie
 
Join Date: Mar 2004
Posts: 1
Rep Power: 0 zdawg is on a distinguished road
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
__________________
Me & Myself just ganged up on I....... Now We all have problems..and none of Us are speaking!
zdawg is offline   Reply With Quote
Old Apr 14th, 2004, 11:31 PM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,618
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old May 3rd, 2004, 7:05 PM   #3
lordnothing
Newbie
 
Join Date: Apr 2004
Location: ~/
Posts: 8
Rep Power: 0 lordnothing is on a distinguished road
Send a message via AIM to lordnothing Send a message via MSN to lordnothing
try adding an if....fi statement to it that includes the following:
ifconfig|grep ppp0
__________________
int main{
int count;
for(count=0;count<99;count++){
printf("I will not throw paper airplanes.\n");}
}
lordnothing is offline   Reply With Quote
Old Jul 15th, 2004, 4:36 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,453
Rep Power: 7 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
You could also try using a sleep command to wait for a specific interval to
allow the process to finish.

IR
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:20 AM.

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