Skip to content

Commit 9b7e7bc

Browse files
dsemkowicz-ttmerge
authored andcommitted
tools: ts_uinput_start.sh: Remove unnecessary ls call
There was unnecessary call to "ls". ts_uinput output can be grepped directly for 'event' string, without creating additional variable. Simplify "! -z" to "-n" as suggested by shellcheck. Signed-off-by: Daniel Semkowicz <[email protected]>
1 parent becd019 commit 9b7e7bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/ts_uinput_start.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
# This starts ts_uinput as a daemon and creates /dev/input/ts_uinput to use
66
# as an evdev input device
77

8-
TS_UINPUT_DEV_FILE=$(ts_uinput -d -v)
9-
TS_UINPUT_DEV_FILE_CHECKED=$(ls "$TS_UINPUT_DEV_FILE" | grep 'event')
8+
TS_UINPUT_DEV_FILE=$(ts_uinput -d -v | grep 'event')
109

11-
if [ ! -z "$TS_UINPUT_DEV_FILE_CHECKED" ]
10+
if [ -n "$TS_UINPUT_DEV_FILE" ]
1211
then
1312
rm -f /dev/input/ts_uinput
14-
ln -s $TS_UINPUT_DEV_FILE_CHECKED /dev/input/ts_uinput
13+
ln -s "$TS_UINPUT_DEV_FILE" /dev/input/ts_uinput
1514
else
1615
echo "ts_uinput: Error creating event device"
1716
exit 1

0 commit comments

Comments
 (0)