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