aboutsummaryrefslogtreecommitdiff
path: root/bin/syncmodules
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-27 13:30:28 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-27 13:30:28 -0200
commit779e5bd9113a76dd5bb77518c36388e96b7ff7bc (patch)
treeeb30c1cf462cc97169598f58ce74a68d1e2d3c09 /bin/syncmodules
parent3022f8f8e9d67ec73801ad2068a1d32f2381bd94 (diff)
downloadpuppet-bootstrap-779e5bd9113a76dd5bb77518c36388e96b7ff7bc.tar.gz
puppet-bootstrap-779e5bd9113a76dd5bb77518c36388e96b7ff7bc.tar.bz2
Adds syncmodules
Diffstat (limited to 'bin/syncmodules')
-rwxr-xr-xbin/syncmodules30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/syncmodules b/bin/syncmodules
new file mode 100755
index 0000000..1f5dd07
--- /dev/null
+++ b/bin/syncmodules
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Setup symlinks.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+MODULES="$1"
+
+# Check parameters
+if [ -z "$MODULES" ]; then
+ echo "Usage: $BASENAME <submodules-folder>"
+ exit 1
+elif [ ! -e "$MODULES" ]; then
+ echo "Not found: $MODULES"
+fi
+
+# Add module symlinks using absolute folders
+for module in `ls $MODULES`; do
+ if [ "$module" == "bootstrap" ]; then
+ continue
+ fi
+
+ if echo "$module" | grep -q "^site_"; then
+ continue
+ fi
+
+ path="`cd $MODULES/$module && pwd`"
+ ( cd modules &> /dev/null && rsync -av --delete $path/ $module/ )
+done