#1  
Old 3rd May 2011, 18:21
collimic collimic is offline
Member
 
Join Date: Dec 2008
Posts: 43
Thanks: 7
Thanked 0 Times in 0 Posts
Default Bash input Question

Sorry Very new to bash.

I am trying to create a bash script to block my internet users.

It looks like this
Code:
#! /bin/bash
iptables -A FORWARD -s 192.168.1.222 -j DROP
I would like to be able for this script to ask for the IP address and ad it itself.
where I try block and an ip address and it changes the script to match.

./block 192.168.1.223 and it will block that IP
Reply With Quote
Sponsored Links
  #2  
Old 4th May 2011, 17:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Take a look at the "Positional parameters" section on http://tldp.org/LDP/abs/html/othertypesv.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following 2 Users Say Thank You to falko For This Useful Post:
collimic (6th May 2011), erosbk (6th May 2011)
  #3  
Old 6th May 2011, 04:44
erosbk erosbk is offline
Senior Member
 
Join Date: Mar 2011
Posts: 337
Thanks: 49
Thanked 36 Times in 30 Posts
 
Default

Good tutorial xD
Reply With Quote
The Following User Says Thank You to erosbk For This Useful Post:
collimic (6th May 2011)
Reply

Bookmarks

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
All my mail is going to /var/mail/vmail _sluimers_ Installation/Configuration 21 10th January 2011 13:21
Facing problem with ICMP (ping request) princeu28 Installation/Configuration 5 14th August 2008 00:13
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 16:26
Cannot log onto pop3 server Debian Etch Perfect Server docean Installation/Configuration 2 19th March 2008 00:23
https protocol stops page load tjd General 7 18th November 2007 18:06


All times are GMT +2. The time now is 18:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.