Merge pull request #590 from ceph/generate-sample-osx

generate sample: fix sed on OSX
pull/586/head
Leseb 2016-03-02 10:53:13 +01:00
commit 3c5fccbc2d
1 changed files with 25 additions and 16 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
@ -32,7 +32,16 @@ EOF
continue continue
fi fi
if [ "$(uname)" == "Darwin" ]; then
sed '/^---/d; s/^\([A-Za-z[:space:]]\)/#\1/' \
"$defaults" >> "$basedir"/group_vars/"$output"
echo >> "$basedir"/group_vars/"$output"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sed '/^---/d; s/^\([A-Za-z[:space:]].\+\)/#\1/' \ sed '/^---/d; s/^\([A-Za-z[:space:]].\+\)/#\1/' \
"$defaults" >> "$basedir"/group_vars/"$output" "$defaults" >> "$basedir"/group_vars/"$output"
echo >> "$basedir"/group_vars/"$output" echo >> "$basedir"/group_vars/"$output"
else
echo "Unsupported platform"
exit 1
fi
done done