M #-: Sanitize init script names (#225)

Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
pull/228/head
Petr Ospalý 4 years ago committed by GitHub
parent b64deb39d3
commit 8a4026e4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,9 +40,16 @@ cd "${MOUNT_DIR}"
_result=0
for f in $INIT_SCRIPTS; do
cp "${f}" "${TMP_DIR}/"
chmod +x "${TMP_DIR}/${f}"
"${TMP_DIR}/${f}" || _result=$?
f=$(basename "$f")
if [ -f "$f" ] ; then
cp "${f}" "${TMP_DIR}/"
chmod +x "${TMP_DIR}/${f}"
"${TMP_DIR}/${f}" || _result=$?
else
echo "ERROR: Init script does not exist: ${f}" >&2
_result=1
fi
done
exit $_result

Loading…
Cancel
Save