AWS: Fixed compacting script of cloud init for MacOS

In MacOS there is error during setup a new cluster:

```
+ sed -i -e 's/^[[:blank:]]*#.*$//' -e '/^[[:blank:]]*$/d' /sometmpfile
sed: -e: No such file or directory
```

Because sed version of MacOS does not support modern features.
pull/6/head
Michael Nikitochkin 2015-12-16 09:20:57 +01:00
parent 9033311475
commit 2272de1f67
1 changed files with 3 additions and 2 deletions

View File

@ -895,8 +895,9 @@ function start-master() {
# We're running right up against the 16KB limit
# Remove all comment lines and then put back the bin/bash shebang
sed -i -e 's/^[[:blank:]]*#.*$//' -e '/^[[:blank:]]*$/d' "${KUBE_TEMP}/master-user-data"
sed -i '1i #! /bin/bash' "${KUBE_TEMP}/master-user-data"
cat "${KUBE_TEMP}/master-user-data" | sed -e 's/^[[:blank:]]*#.*$//' | sed -e '/^[[:blank:]]*$/d' > "${KUBE_TEMP}/master-user-data.tmp"
echo '#! /bin/bash' | cat - "${KUBE_TEMP}/master-user-data.tmp" > "${KUBE_TEMP}/master-user-data"
rm "${KUBE_TEMP}/master-user-data.tmp"
echo "Starting Master"
master_id=$($AWS_CMD run-instances \