Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 | Use of Commands via RFID logs out errors #1967

Closed
AlvinSchiller opened this issue Feb 2, 2023 · 0 comments · Fixed by #1968
Closed

🐛 | Use of Commands via RFID logs out errors #1967

AlvinSchiller opened this issue Feb 2, 2023 · 0 comments · Fixed by #1968
Milestone

Comments

@AlvinSchiller
Copy link
Collaborator

Bug

What I did

I installed with the One line install command on Raspberry Pi OS Buster

What happened

If a command is executed via RFID (or by calling the rfid_trigger_play.sh manually) the script fails with "Line 354: [: too many arguments". The command is executed though and no error is recognizable in functionality.
Non command execution works without errors.

I expected this to happen

The script runs without producing errors

Further information that might help

The "if-statement" in rfid_trigger_play.sh has an "is set" check for variable "${FOLDER+x}". The variable is unquoted what is producing an error with the subsequent inline check, if a command is executed and the "FOLDER" variable is not set.

Solution: The variable "${FOLDER+x}" must be quoted or the check can even be completly removed, as the "is empty" check should be sufficient in this case (variable cannot be "not empty" but "not set")

Software

Base image and version

2022-09-22-raspios-buster-armhf-lite.img

Branch / Release

master

Installscript

scripts/installscripts/buster-install-default.sh

Hardware

RaspberryPi version

4B

RFID Reader

Soundcard

Onboard

Other notable hardware

AlvinSchiller added a commit to AlvinSchiller/RPi-Jukebox-RFID that referenced this issue Feb 2, 2023
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
@s-martin s-martin linked a pull request Feb 3, 2023 that will close this issue
@s-martin s-martin added bash and removed needs triage labels Feb 3, 2023
@s-martin s-martin added this to the 2.x(.x) next milestone Feb 3, 2023
s-martin pushed a commit that referenced this issue Mar 10, 2023
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
AlvinSchiller added a commit to AlvinSchiller/RPi-Jukebox-RFID that referenced this issue Dec 21, 2023
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants