fix tests for UID and GID
This commit is contained in:
parent
dd8f967646
commit
6422421294
@ -7,14 +7,6 @@ convertCase () {
|
||||
printf "%s" "$1" | tr "[:lower:]" "[:upper:]"
|
||||
}
|
||||
|
||||
testInteger () {
|
||||
if ! [ "$1" -eq "$1" ] 2>/dev/null; then
|
||||
return 0
|
||||
else
|
||||
return "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# instantiate variables
|
||||
sqlCmd='/tmp/cmd.sql'
|
||||
|
||||
@ -22,17 +14,18 @@ sqlCmd='/tmp/cmd.sql'
|
||||
MYSQL_SKIP_NAME_RESOLVE=$(convertCase "$MYSQL_SKIP_NAME_RESOLVE")
|
||||
|
||||
# verify environment variables have valid values
|
||||
if [ "$(testInteger $MYSQL_UID)" -gt 0 ]; then
|
||||
printf "Setting mysql UID to %s\n" "$MYSQL_UID"
|
||||
else
|
||||
if ! [ "$MYSQL_UID" -eq "$MYSQL_UID" ]; then
|
||||
printf "'%s' is not a valid value for MYSQL_UID\n" "$MYSQL_UID"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$(testInteger $MYSQL_GID)" -gt 0 ]; then
|
||||
printf "Setting mysql GID to %s\n" "$MYSQL_GID"
|
||||
else
|
||||
printf "Setting mysql UID to %s\n" "$MYSQL_UID"
|
||||
fi
|
||||
if ! [ $MYSQL_GID -eq "$MYSQL_UID" ]; then
|
||||
printf "'%s' is not a valid value for MYSQL_GID\n" "$MYSQL_UID"
|
||||
exit 1
|
||||
else
|
||||
printf "Setting mysql GID to %s\n" "$MYSQL_GID"
|
||||
|
||||
fi
|
||||
if [ "$MYSQL_SKIP_NAME_RESOLVE" != "TRUE" ] && [ "$MYSQL_SKIP_NAME_RESOLVE" != "FALSE" ]; then
|
||||
printf "MYSQL_SKIP_NAME_RESOLVE must be either 'TRUE' or 'FALSE'\n"
|
||||
|
Loading…
Reference in New Issue
Block a user