summaryrefslogtreecommitdiff
path: root/puppet/bin/symlinks
blob: 0a221c45c7fe2e089824f5faecbf14428b9f3453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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
    path="`cd $MODULES/$module && pwd`"
    ( cd modules &> /dev/null && ln -sf $path )
  fi
done