diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-10-24 09:19:58 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-10-24 09:19:58 -0200 |
commit | e4ae97e75dd88884340792795ccfce942a199dae (patch) | |
tree | 4e66d8e48d001fdf6acb0cacb09ac50fe6d738cc | |
parent | de1a6dcb48d504a270aa89a9f8afa9922cea0d70 (diff) | |
download | puppet-bootstrap-e4ae97e75dd88884340792795ccfce942a199dae.tar.gz puppet-bootstrap-e4ae97e75dd88884340792795ccfce942a199dae.tar.bz2 |
Adds copymodules
-rwxr-xr-x | bin/copymodules | 30 |
1 files changed, 30 insertions, 0 deletions
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 <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 && cp -r $path . ) +done |