diff options
author | root <root@krebs> | 2011-09-09 18:20:34 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-09-09 18:20:34 +0200 |
commit | 176c9ac08ad9c2ddc430b2d1a194f6be41115f5b (patch) | |
tree | 82ea214ff1d45799099576e4ff007c34a6b7c990 /retiolum/bin/update_tinc_hosts | |
parent | dac9eb2553987778500e0bc7e54ad2a28124969d (diff) | |
parent | 150ce5757d2982da740bd9ce2b44b57b6d2831c6 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/bin/update_tinc_hosts')
-rwxr-xr-x | retiolum/bin/update_tinc_hosts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/retiolum/bin/update_tinc_hosts b/retiolum/bin/update_tinc_hosts index fe0785e3..86a28992 100755 --- a/retiolum/bin/update_tinc_hosts +++ b/retiolum/bin/update_tinc_hosts @@ -29,9 +29,13 @@ case "${*-I am made of stupid}" in ;; ('create magic') $0 has magic || $0 print magic >> $hosts < /dev/null + $0 start ;; ('destroy magic') - $0 has magic && sed -ie "/^$bs$/,/^$es$/d" $hosts + if $0 has magic; then + cache="`cat $hosts`" + echo "$cache" | sed "/^$bs$/,/^$es$/d" > $hosts + fi ;; ('has magic') grep -q "^$bs$" $hosts && grep -q "^$es$" $hosts |