summaryrefslogtreecommitdiffstats
path: root/services/bin/sync-host-to-services
diff options
context:
space:
mode:
Diffstat (limited to 'services/bin/sync-host-to-services')
-rwxr-xr-xservices/bin/sync-host-to-services15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/bin/sync-host-to-services b/services/bin/sync-host-to-services
new file mode 100755
index 00000000..526bc569
--- /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 ../../retiolum/hosts -type f | while read hostfile;do
+ host=$(basename "$hostfile")
+ if test -e "$outdir/$host";then
+ printf "${green}$host already exists$nc\n"
+ else
+ printf "${red}$host missing, adding${nc}\n"
+ cat ../services.txt | sed "s#{{hostname}}#$host#" > $outdir/$host
+ fi
+done