Koozali.org: home of the SME Server

Remove AllowHost entry for specific service

Offline doublecaps

  • **
  • 24
  • +0/-0
Remove AllowHost entry for specific service
« on: August 06, 2009, 01:11:37 AM »
I recently added an AllowHost entry on one of the services running on SME server.
Now I need to remove that entry to it will allow all traffic on that port/service again.

Is there a way to "delete" part of the config with a template?

I found this on the WIKI page (http://wiki.contribs.org/Firewall)

To remove a specific entry but leave other existing entries unchanged
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
where entry-to-be-removed is the IP to be removed

I dont' fully understand it so I'm reluctant to use it.


Thanks in advance

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Remove AllowHost entry for specific service
« Reply #1 on: August 06, 2009, 03:22:08 AM »
doublecaps

See related answer here
http://forums.contribs.org/index.php/topic,43999.msg214547.html#msg214547

Quote
To remove a specific entry but leave other existing entries unchanged
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
where entry-to-be-removed is the IP to be removed

I dont' fully understand it so I'm reluctant to use it.

Replace
entry-to-be-removed
with the IP you wish to remove
then issue the whole comand, replacing of course the key name and property ie
squid BypassProxyFrom
with
smtpd AllowHosts
« Last Edit: August 06, 2009, 03:58:49 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Remove AllowHost entry for specific service
« Reply #2 on: August 06, 2009, 10:44:17 AM »
To remove a specific entry but leave other existing entries unchanged
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
where entry-to-be-removed is the IP to be removed

I dont' fully understand it so I'm reluctant to use it.
Next time, please try and use the code tag as that makes code fragments much more readbale don't you think?

Code: [Select]
config setprop squid BypassProxyFrom $(config getprop squid BypassProxyFrom | sed -e 's/entry-to-be-removed//' -e 's/^,//' -e 's/,$//' -e 's/,,//')
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)