diff options
author | varac <varacanero@zeromail.org> | 2013-06-14 20:31:22 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2013-06-14 20:31:22 +0200 |
commit | a4b8195e7a5d444448b3750d66ec725d6f7c67ab (patch) | |
tree | c6c00ece73c7ddb9813869e2b10b6a862e26c035 /templates | |
parent | 8a54ee6ff08c7b498e8da8f5e8ca6827c4d0ff58 (diff) | |
parent | a336f39c441b7b3706278332cc63782d2de0e299 (diff) |
Merge remote-tracking branch 'leap/feature/refresh_stunnels'
Diffstat (limited to 'templates')
-rw-r--r-- | templates/refresh_stunnel.sh.erb | 22 |
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 + + + |