summaryrefslogtreecommitdiff
path: root/tools/mk_smtp_rules
diff options
context:
space:
mode:
authorroot <root@cloud.av8n.net>2012-07-13 00:51:35 -0700
committerJohn Denker <jsd@av8n.com>2012-07-13 18:39:52 -0700
commit1d7eff0ba635ac5983bed820dd349af2ebee0850 (patch)
treeca33be1951d64bf1e3f36fdd77903dc16a9644b3 /tools/mk_smtp_rules
parent1ead9453f3dfc28cf797aafbcc7b6e56b69c4770 (diff)
better comments, working toward MODE switching
Diffstat (limited to 'tools/mk_smtp_rules')
-rwxr-xr-xtools/mk_smtp_rules11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/mk_smtp_rules b/tools/mk_smtp_rules
index 85c3298..eb241b0 100755
--- a/tools/mk_smtp_rules
+++ b/tools/mk_smtp_rules
@@ -3,16 +3,19 @@
# if /etc/tcpserver/smtp.rules does not already exist,
# create it with some reasonable defaults
-dest=/etc/tcpserver/smtp.rules
+dest=$1
+
+: ${dest:=/etc/tcpserver/smtp.rules}
install -d $( dirname $dest )
-if ! test -r $dest ; then
+if test -r $dest ; then
+ 1>&2 echo "Oops, destination '$dest' already exists."
+ exit 1
+fi
<<EoF cat > $dest
10.:allow,RELAYCLIENT=""
127.0.0.:allow,RELAYCLIENT=""
:allow
EoF
-
-fi