On 2015/03/09 17:16, Leslie Jensen wrote:
> Hello list.
> 
> I have a problem with a simple script I've written to keep two tables
> up to date. I have a few hosts I need to give access to my LAN via the
> table goodguys. With these hosts being on a dynamic IP address I have
> to have them registered via no-ip.
> 
> If the look up of FQDN for one of the hosts in my script fails the
> remaining hosts and IP-addresses will not be added to the table
> goodguys.
> 
> I'm aware that this is a case of poor scripting and I would very much
> like your feedback on how I can avoid an unknown host to make my script
> fail.
> 
> Thank you :-)
> 
> /Leslie
> 
> 
> My script:
> 
> #!/bin/sh
> #
> #
> pfctl -F Tables
> #
> #
> pfctl -t goodguys -T add host1.no-ip.org host2.no-ip.org www.host3.nu
> ipa.ddr.ess.002 ipa.ddr.ess.001
> #
> #
> pfctl -t goodguys2 -T add ipa.ddr.ess.003 ipa.ddr.ess.004
> ipa.ddr.ess.005
> #
> #
> pfctl -T show -t goodguys
> pfctl -T show -t goodguys2
> 

You could add each host on a separate line.

pfctl -t goodguys -T add host1.no-ip.org
pfctl -t goodguys -T add host2.no-ip.org

etc.

Reply via email to