use isInt and test for +ve values for UID/GID
This commit is contained in:
parent
6a7c9602d4
commit
9290a3388b
@ -24,18 +24,17 @@ sqlCmd='/tmp/cmd.sql'
|
|||||||
MYSQL_SKIP_NAME_RESOLVE=$(convertCase "$MYSQL_SKIP_NAME_RESOLVE")
|
MYSQL_SKIP_NAME_RESOLVE=$(convertCase "$MYSQL_SKIP_NAME_RESOLVE")
|
||||||
|
|
||||||
# verify environment variables have valid values
|
# verify environment variables have valid values
|
||||||
if ! [ "$MYSQL_UID" -eq "$MYSQL_UID" ]; then
|
if [ "$(isInt "$MYSQL_UID")" -ge 0 ]; then
|
||||||
|
printf "Setting mysql UID to %s\n" "$MYSQL_UID"
|
||||||
|
else
|
||||||
printf "'%s' is not a valid value for MYSQL_UID\n" "$MYSQL_UID"
|
printf "'%s' is not a valid value for MYSQL_UID\n" "$MYSQL_UID"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
printf "Setting mysql UID to %s\n" "$MYSQL_UID"
|
|
||||||
fi
|
fi
|
||||||
if ! [ "$MYSQL_GID" -eq "$MYSQL_UID" ]; then
|
if [ "$(isInt "$MYSQL_GID")" -ge 0 ]; then
|
||||||
|
printf "Setting mysql GID to %s\n" "$MYSQL_GID"
|
||||||
|
else
|
||||||
printf "'%s' is not a valid value for MYSQL_GID\n" "$MYSQL_UID"
|
printf "'%s' is not a valid value for MYSQL_GID\n" "$MYSQL_UID"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
printf "Setting mysql GID to %s\n" "$MYSQL_GID"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ "$MYSQL_SKIP_NAME_RESOLVE" != "TRUE" ] && [ "$MYSQL_SKIP_NAME_RESOLVE" != "FALSE" ]; then
|
if [ "$MYSQL_SKIP_NAME_RESOLVE" != "TRUE" ] && [ "$MYSQL_SKIP_NAME_RESOLVE" != "FALSE" ]; then
|
||||||
printf "MYSQL_SKIP_NAME_RESOLVE must be either 'TRUE' or 'FALSE'\n"
|
printf "MYSQL_SKIP_NAME_RESOLVE must be either 'TRUE' or 'FALSE'\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user