Skip to content

raspinfo: remove bashisms to run on sh #43

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions raspinfo/raspinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# Some of the regex's used in sed
# Catch basic IP6 address "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g"
Expand All @@ -11,7 +11,7 @@ display_info_drm() {
# If running X then can use xrandr, otherwise
# dump the /sys/class entries for the displays
if command -v xrandr > /dev/null &&
DISPLAY=${DISPLAY:-:0} xrandr --listmonitors &>/dev/null;
DISPLAY=${DISPLAY:-:0} xrandr --listmonitors >/dev/null 2>&1;
then
echo "Running (F)KMS and X"
echo
Expand Down Expand Up @@ -77,7 +77,7 @@ display_info_drm() {
cardfound=1
fi
done
if [ "$cardfound" == "0" ];
if [ "$cardfound" = "0" ];
then
echo "kms state not found"
fi
Expand Down Expand Up @@ -137,7 +137,11 @@ OUT=raspinfo.txt

rm -f $OUT

exec > >(tee -ia $OUT)
# avoid process substition bashism to generate logfile
PIPE_PATH=$(mktemp -u)
mkfifo $PIPE_PATH
tee -ia $OUT < $PIPE_PATH &
exec > $PIPE_PATH

echo "System Information"
echo "------------------"
Expand Down