Display Hardware MAC Addresses During Install
Posted: 15 Jul 2015, 01:52
Here's a little modification to the 003-settings.xzm module I whipped up for a Porteus Kiosk deployment at my university. Not all of our hardware is properly labeled, so I modified the ISO with the following script which displays all hardware MAC addresses as notifications during the install wizard. This is admittedly very crude and can be executed more than once if the wizard fails to make a successful Internet connection (an if statement to check for the existence of the temp file would fix that); however, I needed a solution as quickly as possible, and it's worked fine so far. Thought I would share it with the community. Unified diff follows:
Feel free to post any improvements to the code you might have.
Code: Select all
--- 003-settings/opt/porteus-scripts/welcome 2015-05-30 09:41:44.000000000 -0500
+++ 003-settings/opt/porteus-scripts/welcome 2015-07-14 08:58:47.677963216 -0500
@@ -54,6 +54,13 @@
## Main dialog
## ====================================================================
+# Display hardware MAC addresses as notifications
+ifconfig -a | grep HWaddr | tr -d '\t' > /tmp/hwaddr.tmp
+while IFS= read -r addr
+do
+ dunstify -u critical "$addr"
+done < /tmp/hwaddr.tmp
+
## Trap exits
trap 'cleanup' 2 14 15