[squid-users] Re: removing / allowing IPs

From: Adam Aube <aaube01@dont-contact.us>
Date: Tue, 29 Jun 2004 22:54:10 -0400

Payal Rathod wrote:

> Many times when I am not in office my boss wants to
> allow or disable access to a particular IP. He is not
> familar with vi or any other CLI editor In Linux and I
> am afraid he may mess the file.

A basic shell script can do this easily. Something like this bash script:

[[ $1 == "add" ]] && echo $2 >> /path/to/acl_file
[[ $1 == "del" ]] && grep -v "$2" /path/to/acl_file > acl_file
exit 0

Have your boss run the script like this:

script_name (add|del) ip_address

Note that this script is just an example - it's very primitive, and should
not be used in a production environment. You should add checks to make sure
that the required parameters are given, and that the value given for the IP
address is valid.

Adam
Received on Tue Jun 29 2004 - 20:52:08 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Jul 01 2004 - 12:00:03 MDT