Koozali.org: home of the SME Server

BypassProxy request

Offline kryptos

  • *****
  • 245
  • +0/-0
BypassProxy request
« on: July 28, 2009, 11:15:46 AM »
Hi All,

I've been using this command from this link http://wiki.contribs.org/Firewall#Bypass_Proxy and every time I add new IP address from the list I need to add all previous IP address. For example in this first command I do this config setprop squid BypassProxyFrom 192.168.1.1   but if want to add another I need to include the first IP with the new additional address like this config setprop squid BypassProxyFrom 192.168.1.1,192.168.1.2,...etc and so on now imagine if I add another 20 more it will be a long list. Is there a way that I could add individual IP address without having to include already added IP address.

Regards,
Rocel

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: BypassProxy request
« Reply #1 on: July 28, 2009, 02:35:02 PM »
Is there a way that I could add individual IP address without having to include already added IP address.

config setprop squid BypassProxyFrom a.b.c.d,$(config getprop squid PypassProxyFrom)

Offline raem

  • *
  • 3,972
  • +4/-0
Re: BypassProxy request
« Reply #2 on: July 28, 2009, 03:04:56 PM »
Charlie

Good one Charlie, added here
http://wiki.contribs.org/Firewall#Bypass_Proxy
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: BypassProxy request
« Reply #3 on: July 28, 2009, 03:26:32 PM »
Charlie

Good one Charlie, added here
http://wiki.contribs.org/Firewall#Bypass_Proxy
It is not that special (for linux at least), it makes use of 'subshell' to retrieve the original setting and echo that to the shell command of the user, it can be done with all kinds of commands, see for instance http://tldp.org/LDP/abs/html/subshells.html for more information on subshells.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline kryptos

  • *****
  • 245
  • +0/-0
Re: BypassProxy request
« Reply #4 on: July 29, 2009, 04:20:34 AM »
config setprop squid BypassProxyFrom a.b.c.d,$(config getprop squid PypassProxyFrom)

Thanks Charlie. How about if we want to delete specific IP in that list. Sorry for the many questions i have ask it just have only a  little knowledge  with linux commands. Though I learn a lot on linux with SME but not all.

Regards,
Rocel

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: BypassProxy request
« Reply #5 on: July 29, 2009, 07:12:05 AM »
Thanks Charlie. How about if we want to delete specific IP in that list. Sorry for the many questions i have ask it just have only a  little knowledge  with linux commands. Though I learn a lot on linux with SME but not all.

From the top of my head:
Code: [Select]
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
First sed is to remove the entry, the last second is to remove the comma at the beginning, the second for a comma at the end and the last to remove the double comma when an entry is removed at the middle of the list.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline kryptos

  • *****
  • 245
  • +0/-0
Re: BypassProxy request
« Reply #6 on: July 30, 2009, 09:22:39 AM »
From the top of my head:
Code: [Select]
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
First sed is to remove the entry, the last second is to remove the comma at the beginning, the second for a comma at the end and the last to remove the double comma when an entry is removed at the middle of the list.



Thank you very much.

Regards,
Rocel