Skip to content

Commit

Permalink
meta-lxatac-bsp: lxatac-led-setup: use [[ ]] for tests
Browse files Browse the repository at this point in the history
This was suggested by shellcheck.

Signed-off-by: Leonard Göhrs <[email protected]>
  • Loading branch information
hnez committed Dec 12, 2023
1 parent 26dfd20 commit c897798
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ USB_HOST2="tac:green:usbh2"
USB_HOST3="tac:green:usbh3"

# RGB Status LED
if [ -e "${BASE}/${STATUS}/trigger" ]
if [[ -e "${BASE}/${STATUS}/trigger" ]]
then
# Light up in a nice yellow, as the "okay green" is a bit overused by
# the other LEDs.
Expand All @@ -28,7 +28,7 @@ else
fi

# CAN Interface activity
if [ -e "${BASE}/${IOBUS}/trigger" ]
if [[ -e "${BASE}/${IOBUS}/trigger" ]]
then
echo netdev > "${BASE}/${IOBUS}/trigger"
echo can0_iobus > "${BASE}/${IOBUS}/device_name"
Expand All @@ -39,7 +39,7 @@ else
echo "Not setting up IOBus Trigger"
fi

if [ -e "${BASE}/${CAN}/trigger" ]
if [[ -e "${BASE}/${CAN}/trigger" ]]
then
echo netdev > "${BASE}/${CAN}/trigger"
echo can1 > "${BASE}/${CAN}/device_name"
Expand All @@ -51,7 +51,7 @@ else
fi

# DUT UART activity
if [ -e "${BASE}/${UART_RX}/trigger" ]
if [[ -e "${BASE}/${UART_RX}/trigger" ]]
then
echo tty > "${BASE}/${UART_RX}/trigger"
echo ttySTM1 > "${BASE}/${UART_RX}/ttyname"
Expand All @@ -61,7 +61,7 @@ else
echo "Not setting up UART RX Trigger"
fi

if [ -e "${BASE}/${UART_TX}/trigger" ]
if [[ -e "${BASE}/${UART_TX}/trigger" ]]
then
echo tty > "${BASE}/${UART_TX}/trigger"
echo ttySTM1 > "${BASE}/${UART_TX}/ttyname"
Expand All @@ -72,23 +72,23 @@ else
fi

# USB Host ports
if [ -e "${BASE}/${USB_HOST1}/trigger" ]
if [[ -e "${BASE}/${USB_HOST1}/trigger" ]]
then
echo usbport > "${BASE}/${USB_HOST1}/trigger"
echo 1 > "${BASE}/${USB_HOST1}/ports/1-1-port1"
else
echo "Not setting up USB Host 1 Trigger"
fi

if [ -e "${BASE}/${USB_HOST2}/trigger" ]
if [[ -e "${BASE}/${USB_HOST2}/trigger" ]]
then
echo usbport > "${BASE}/${USB_HOST2}/trigger"
echo 1 > "${BASE}/${USB_HOST2}/ports/1-1-port2"
else
echo "Not setting up USB Host 2 Trigger"
fi

if [ -e "${BASE}/${USB_HOST3}/trigger" ]
if [[ -e "${BASE}/${USB_HOST3}/trigger" ]]
then
echo usbport > "${BASE}/${USB_HOST3}/trigger"
echo 1 > "${BASE}/${USB_HOST3}/ports/1-1-port3"
Expand Down

0 comments on commit c897798

Please sign in to comment.