From: Silvio Rhatto Date: Tue, 24 Oct 2017 11:19:58 +0000 (-0200) Subject: Adds copymodules X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e4ae97e75dd88884340792795ccfce942a199dae;p=puppet-bootstrap.git Adds copymodules --- diff --git a/bin/copymodules b/bin/copymodules new file mode 100755 index 0000000..85f7499 --- /dev/null +++ b/bin/copymodules @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Setup symlinks. +# + +# Parameters +BASENAME="`basename $0`" +MODULES="$1" + +# Check parameters +if [ -z "$MODULES" ]; then + echo "Usage: $BASENAME " + 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 && cp -r $path . ) +done