From: Justin Wind Date: Sat, 28 Jan 2017 20:57:26 +0000 (-0800) Subject: move message funcs into common X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=147ddf903dde4c7e2b2ca4008449c10505bc5ae8;p=firewall-squeep move message funcs into common --- 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' "$@" }