Skip to content

Commit

Permalink
Add MAC addresses on PlayOS status screen
Browse files Browse the repository at this point in the history
This adds the PC's MAC addresses in text and QR encoding to the status console, which may be used during initial provisioning to print labels to place on the device packaging.
  • Loading branch information
knuton committed May 24, 2024
1 parent 17dc536 commit e6be7a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/playos-status.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ let
while :; do
screen=$(xrandr --current | grep '*' | awk '{print $1}')
networkCount=$(connmanctl services | grep wifi | wc -l)
ethernetMacs=$(cat /sys/class/net/e*/address 2>/dev/null | grep -v '^$' | awk '{print "Ethernet " $0}' | tr '\n' ' ')
wlanMacs=$(cat /sys/class/net/wl*/address 2>/dev/null | grep -v '^$' | awk '{print "WLAN " $0}' | tr '\n' ' ')
rfid=$(opensc-tool --list-readers | pr -T -o 2)
dataDiskFree=$(df -h /mnt/data | pr -T -o 2)
controller=$(systemctl is-active playos-controller)
Expand All @@ -23,8 +25,11 @@ let
"Persistent storage:" \
"$dataDiskFree" \
"Controller: $controller" \
"Updated at: $time" \
"Network interfaces: $ethernetMacs $wlanMacs" \
> ${ttyPath}
qrencode -m 2 -t utf8 <<< "$ethernetMacs $wlanMacs" \
> ${ttyPath}
printf "\n%s" "Updated at: $time" > ${ttyPath}
sleep 5
done
'';
Expand All @@ -43,6 +48,7 @@ in
xorg.xrandr
opensc
coreutils
qrencode
];
description = "PlayOS status";
wantedBy = [ "multi-user.target" ];
Expand Down
1 change: 1 addition & 0 deletions controller/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- kiosk: Add a key combination to perform hard refresh (Ctrl-Shift-R)
- os: Added localization options for Polish and Czech
- controller: Add licensing page in System Settings
- status screen: Display MAC addresses in text and QR code

## Changed

Expand Down

0 comments on commit e6be7a3

Please sign in to comment.