Skip to content

Instantly share code, notes, and snippets.

@k1LoW
Created February 20, 2013 06:30
Show Gist options
  • Select an option

  • Save k1LoW/4993416 to your computer and use it in GitHub Desktop.

Select an option

Save k1LoW/4993416 to your computer and use it in GitHub Desktop.
function fluent-allow () {
if [ "`id -u`" == "0" ] ; then
iptables -A INPUT -m state --state NEW -s $1 -m tcp -p tcp --dport 24224 -j ACCEPT
iptables -A INPUT -m state --state NEW -s $1 -m udp -p udp --dport 24224 -j ACCEPT
else
sudo /sbin/iptables -A INPUT -m state --state NEW -s $1 -m tcp -p tcp --dport 24224 -j ACCEPT
sudo /sbin/iptables -A INPUT -m state --state NEW -s $1 -m udp -p udp --dport 24224 -j ACCEPT
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment