summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-06-14 20:31:22 +0200
committervarac <varacanero@zeromail.org>2013-06-14 20:31:22 +0200
commita4b8195e7a5d444448b3750d66ec725d6f7c67ab (patch)
treec6c00ece73c7ddb9813869e2b10b6a862e26c035 /templates
parent8a54ee6ff08c7b498e8da8f5e8ca6827c4d0ff58 (diff)
parenta336f39c441b7b3706278332cc63782d2de0e299 (diff)
Merge remote-tracking branch 'leap/feature/refresh_stunnels'
Diffstat (limited to 'templates')
-rw-r--r--templates/refresh_stunnel.sh.erb22
1 files changed, 22 insertions, 0 deletions
diff --git a/templates/refresh_stunnel.sh.erb b/templates/refresh_stunnel.sh.erb
new file mode 100644
index 0000000..1af0cff
--- /dev/null
+++ b/templates/refresh_stunnel.sh.erb
@@ -0,0 +1,22 @@
+#!/bin/sh -x
+
+for difference in `diff -q /etc/stunnel <%= @stunnel_staging %>/configs | grep differ | awk '{print $2}'`
+do
+ old_config=`basename $difference`
+ /etc/init.d/stunnel4 stop $(basename $old_config .conf)
+ rm $difference
+done
+
+for only in `diff -q /etc/stunnel <%= @stunnel_staging %>/configs | grep 'Only in /etc/stunnel:' | awk '{print $4}'`
+do
+ old_config=`basename $only`
+ /etc/init.d/stunnel4 stop $(basename $only .conf)
+ rm /etc/stunnel/${only}
+done
+
+cp <%= @stunnel_staging %>/configs/*.conf /etc/stunnel
+
+/etc/init.d/stunnel4 start
+
+
+