From a592e32c69cdacbfad1c2ac7c2b54c42155c0524 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 27 Mar 2014 13:15:13 +0100 Subject: remove legacy hosts --- services/bin/sync-host-to-services | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 services/bin/sync-host-to-services (limited to 'services/bin') diff --git a/services/bin/sync-host-to-services b/services/bin/sync-host-to-services new file mode 100755 index 00000000..ed795fb6 --- /dev/null +++ b/services/bin/sync-host-to-services @@ -0,0 +1,15 @@ +#!/bin/sh +green='\e[0;32m' +red='\e[0;31m' +nc='\e[0m' + +outdir=${1?please provide services-outdir} +find /etc/tinc/retiolum/hosts/ -type f | while read hostfile;do + host=$(basename "$hostfile") + if test -e "$outdir/$host";then + echo "${green}$host already exists$nc" + else + echo "${red}$host missing, adding${nc}" + cat ../services.txt | sed "s#{{hostname}}#$host#" > $outdir/$host + fi +done -- cgit v1.2.3