Skip to content

Commit

Permalink
Fix 2 bugs
Browse files Browse the repository at this point in the history
- mlat-client user argument needs to be quoted to avoid splitting usernames with spaces
- name_arg parameter needs to be unset between iterations of the loop
  • Loading branch information
kx1t authored Jun 17, 2024
1 parent e3455aa commit fc89489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rootfs/etc/s6-overlay/scripts/mlat-client
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ do
# If the argument starts with "uuid=", then it must be a UUID, etc.
# If the argument isn't any of the above, then it's an "extra argument"

unset uuid_arg lat_arg lon_arg alt_arg input_connect_arg return_port_arg extra_args
unset name_arg uuid_arg lat_arg lon_arg alt_arg input_connect_arg return_port_arg extra_args

for ((i=2; i<${#params[*]}; i++))
do
Expand Down Expand Up @@ -234,7 +234,7 @@ do
MLAT_PARAM+=(--input-connect "${input_connect_arg:-localhost:30005}")

if [[ -n "${name_arg}" ]] || [[ -n "${MLAT_USER}" ]]; then
MLAT_PARAM+=(--user "${name_arg:-${MLAT_USER}}")
MLAT_PARAM+=(--user \""${name_arg:-${MLAT_USER}}"\")
else
rnd="${RANDOM}"
"${s6wrap[@]}" --args echo "WARNING: MLAT_USER is not set - using random number \"${rnd}\" as MLAT_USER"
Expand Down

0 comments on commit fc89489

Please sign in to comment.