File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ function error_exit () {
2525# Run preinstall script if defined
2626RC=0
2727if [ " ${cfn_preinstall} " != " NONE" ]; then
28- wget -qO- ${cfn_preinstall} | /bin/sh || RC=1
28+ tmpfile=$( mktemp)
29+ wget -qO- ${cfn_preinstall} > $tmpfile || RC=1
30+ if [ " ${cfn_preinstall_args} " != " NONE" ]; then
31+ args=${cfn_preinstall_args}
32+ fi
33+ /bin/sh $tmpfile $args || RC=1
34+ /bin/rm $tmpfile
2935fi
3036if [ $RC -ne 0 ]; then
3137 error_exit " Failed to run boot_as_compute preinstall"
124130# Run postinstall script if defined
125131RC=0
126132if [ " ${cfn_postinstall} " != " NONE" ]; then
127- wget -qO- ${cfn_postinstall} | /bin/sh || RC=1
133+ tmpfile=$( mktemp)
134+ wget -qO- ${cfn_postinstall} > $tmpfile || RC=1
135+ if [ " ${cfn_postinstall_args} " != " NONE" ]; then
136+ args=${cfn_postinstall_args}
137+ fi
138+ /bin/sh $tmpfile $args || RC=1
139+ /bin/rm $tmpfile
128140fi
129141if [ $RC -ne 0 ]; then
130142 error_exit " Failed to run boot_as_compute postinstall"
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ function error_exit () {
2525# Run preinstall script if defined
2626RC=0
2727if [ " ${cfn_preinstall} " != " NONE" ]; then
28- wget -qO- ${cfn_preinstall} | /bin/sh || RC=1
28+ tmpfile=$( mktemp)
29+ wget -qO- ${cfn_preinstall} > $tmpfile || RC=1
30+ if [ " ${cfn_preinstall_args} " != " NONE" ]; then
31+ args=${cfn_preinstall_args}
32+ fi
33+ /bin/sh $tmpfile $args || RC=1
34+ /bin/rm $tmpfile
2935fi
3036if [ $RC -ne 0 ]; then
3137 error_exit " Failed to run boot_as_master preinstall"
@@ -200,7 +206,13 @@ cd /opt/cfncluster/sqswatcher && ./sqswatcher.py 2>&1
200206# Run postinstall script if defined
201207RC=0
202208if [ " ${cfn_postinstall} " != " NONE" ]; then
203- wget -qO- ${cfn_postinstall} | /bin/sh || RC=1
209+ tmpfile=$( mktemp)
210+ wget -qO- ${cfn_postinstall} > $tmpfile || RC=1
211+ if [ " ${cfn_postinstall_args} " != " NONE" ]; then
212+ args=${cfn_postinstall_args}
213+ fi
214+ /bin/sh $tmpfile $args || RC=1
215+ /bin/rm $tmpfile
204216fi
205217if [ $RC -ne 0 ]; then
206218 error_exit " Failed to run boot_as_master postinstall"
You can’t perform that action at this time.
0 commit comments