move message funcs into common
authorJustin Wind <justin.wind+git@gmail.com>
Sat, 28 Jan 2017 20:57:26 +0000 (12:57 -0800)
committerJustin Wind <justin.wind+git@gmail.com>
Sat, 28 Jan 2017 20:57:26 +0000 (12:57 -0800)
common.sh

index 1309518af3bce28ffed72d4eb3c72be87ba6d3da..f4da792d9fcdb455cd923cac167b76424c6a7b36 100644 (file)
--- 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' "$@"
 }