diff options
author | drebs <drebs@riseup.net> | 2011-03-11 18:57:31 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2011-03-11 18:57:31 -0300 |
commit | bf29e9cf37fdaa027330d2d0730eb8ff1c975555 (patch) | |
tree | 88f98bc9b170e6c37a0ccd080daca2322926d798 /templates/bin | |
parent | f7c1d1a879c81cd5ea328b191ab6729f05a03984 (diff) | |
download | puppet-bootstrap-bf29e9cf37fdaa027330d2d0730eb8ff1c975555.tar.gz puppet-bootstrap-bf29e9cf37fdaa027330d2d0730eb8ff1c975555.tar.bz2 |
fixing file locations
Diffstat (limited to 'templates/bin')
-rw-r--r-- | templates/bin/puppet-bootstrap | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/templates/bin/puppet-bootstrap b/templates/bin/puppet-bootstrap new file mode 100644 index 0000000..6c16f3f --- /dev/null +++ b/templates/bin/puppet-bootstrap @@ -0,0 +1,34 @@ +#!/bin/sh + +puppet_dir=<%= puppet_dir %> + +function usage { + echo "Usage: $1 add-submodules" + exit $2 +} + +function add_submodules { + cd $puppet_dir + git init + git add . + mkdir -p ./modules + + repos="`lynx -dump http://git.sarava.org/?a=project_index | awk '{ print $1 }' | grep ^puppet-`" + for repo in $repos; do + module="`basename $repo .git | cut -d - -f 2`" + if [ ! -d "modules/$module" ]; then + git submodule add git://git.sarava.org/puppet-$module.git modules/$module + fi + done +} + +if [[ $# -ne 1 ]]; then + usage $0 1 + exit 1 +fi + +case $1 in + add-submodules) add_submodules ;; + help) usage $0 0 ;; + *) usage $0 1; exit 1 ;; +esac |