X-Git-Url: http://git.squeep.com/?p=firewall-squeep;a=blobdiff_plain;f=common.sh;h=f4da792d9fcdb455cd923cac167b76424c6a7b36;hp=1309518af3bce28ffed72d4eb3c72be87ba6d3da;hb=147ddf903dde4c7e2b2ca4008449c10505bc5ae8;hpb=8f282d43f66a96150c9edef5b8ce39f3f6fc3b4d diff --git a/common.sh b/common.sh index 1309518..f4da792 100644 --- a/common.sh +++ b/common.sh @@ -6,6 +6,17 @@ IPTABLES=$(which iptables) IP6TABLES=$(which ip6tables) IPSET=$(which ipset) +err(){ + echo "$@" 1>&2 +} + +die(){ + local status=$1 + shift + err "$@" + exit ${status} +} + function decommentcat(){ sed 's/\s*#.*$//;/^\s*$/d' "$@" }