Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: kryptos 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
-
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)
-
Charlie
Good one Charlie, added here
http://wiki.contribs.org/Firewall#Bypass_Proxy
-
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.
-
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
-
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:
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.
-
From the top of my head:
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