summaryrefslogtreecommitdiff
path: root/templates/refresh_stunnel.sh.erb
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-24 10:19:35 -0400
committerMicah <micah@leap.se>2016-05-24 10:19:35 -0400
commit027eb22ae7ce1fc06f32b7c8920abaf7ff7251a9 (patch)
tree97e0916feed9ecc764ef45f3578fee89ff0b0f5b /templates/refresh_stunnel.sh.erb
Squashed 'puppet/modules/stunnel/' content from commit 79e874c
git-subtree-dir: puppet/modules/stunnel git-subtree-split: 79e874c1a86ad5c48c4e726a5d4c68bd879ce454
Diffstat (limited to 'templates/refresh_stunnel.sh.erb')
-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 00000000..1af0cff7
--- /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
+
+
+