make_mapdef.sh: fix bashisms

This commit is contained in:
Marco Cawthorne 2024-01-02 15:06:32 -08:00
parent d662c12951
commit 177a1638f7
Signed by: eukara
GPG key ID: CE2032F0A2882A22

View file

@ -18,32 +18,32 @@ do
KEY=$(echo "$LINE" | awk -F"\"" '{ print $2 }') KEY=$(echo "$LINE" | awk -F"\"" '{ print $2 }')
VAL=$(echo "$LINE" | awk -F"\"" '{ print $4 }') VAL=$(echo "$LINE" | awk -F"\"" '{ print $4 }')
if [ "$KEY" == "entityDef" ] if [ "$KEY" = "entityDef" ]
then then
printf -- "$VAL" > "/tmp/def_name" printf -- "$VAL" > "/tmp/def_name"
fi fi
if [ "$SEG1" == "entityDef" ] if [ "$SEG1" = "entityDef" ]
then then
printf -- "$SEG2" > "/tmp/def_name" printf -- "$SEG2" > "/tmp/def_name"
fi fi
if [ "$KEY" == "editor_color" ] if [ "$KEY" = "editor_color" ]
then then
printf -- "$VAL" > "/tmp/def_color" printf -- "$VAL" > "/tmp/def_color"
fi fi
if [ "$KEY" == "editor_mins" ] if [ "$KEY" = "editor_mins" ]
then then
printf -- "$VAL" > "/tmp/def_mins" printf -- "$VAL" > "/tmp/def_mins"
fi fi
if [ "$KEY" == "editor_maxs" ] if [ "$KEY" = "editor_maxs" ]
then then
printf -- "$VAL" > "/tmp/def_maxs" printf -- "$VAL" > "/tmp/def_maxs"
fi fi
if [ "$KEY" == "mins" ] if [ "$KEY" = "mins" ]
then then
if [ -z $(cat "/tmp/def_mins") ] if [ -z $(cat "/tmp/def_mins") ]
then then
@ -51,7 +51,7 @@ do
fi fi
fi fi
if [ "$KEY" == "maxs" ] if [ "$KEY" = "maxs" ]
then then
if [ -z $(cat "/tmp/def_maxs") ] if [ -z $(cat "/tmp/def_maxs") ]
then then
@ -59,12 +59,12 @@ do
fi fi
fi fi
if [ "$KEY" == "editor_usage" ] if [ "$KEY" = "editor_usage" ]
then then
printf -- "$VAL" > "/tmp/def_usage" printf -- "$VAL" > "/tmp/def_usage"
fi fi
if [ "$KEY" == "netname" ] if [ "$KEY" = "netname" ]
then then
if [ -z "$(cat "/tmp/def_usage")" ] if [ -z "$(cat "/tmp/def_usage")" ]
then then
@ -72,12 +72,12 @@ do
fi fi
fi fi
if [ "$KEY" == "editor_model" ] if [ "$KEY" = "editor_model" ]
then then
printf -- "$VAL" > "/tmp/def_model" printf -- "$VAL" > "/tmp/def_model"
fi fi
if [ "$KEY" == "model" ] if [ "$KEY" = "model" ]
then then
if [ -z $(cat "/tmp/def_model") ] if [ -z $(cat "/tmp/def_model") ]
then then
@ -85,7 +85,7 @@ do
fi fi
fi fi
if [ "$SEG1" == "}" ] if [ "$SEG1" = "}" ]
then then
KEY_NAME=$(cat "/tmp/def_name") KEY_NAME=$(cat "/tmp/def_name")
KEY_COLOR=$(cat "/tmp/def_color") KEY_COLOR=$(cat "/tmp/def_color")