add tc egress shaping
[firewall-squeep] / common.sh
index 1309518af3bce28ffed72d4eb3c72be87ba6d3da..1e40677e555815434c10762f930e8b94af3d7a95 100644 (file)
--- 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' "$@"