I'm trying to get the Ethernet mac address of a computer that has no display by using a desktop start up file that calls ip.
This is what I have to work with:
Mini-computer with no display: MSI Cubi -231XTW 5th gen Intel® Core™ i7 i7-5500U Mini PC
Two solid state drives with Ubuntu 19.1 installed and upgraded on them (I installed Ubuntu on them using the laptop).
So far I created: /home/max/.config/autostart/hwadd.desktop:
[Desktop Entry] Version=1.0 Name=Get Hardware Address Comment=n/a Exec=hwadd Terminal=false Type=Application Categories=Utility;Application;
I have this script in /usr/bin/hwadd:
cd /home/max/ ip a > /home/max/ipaddress
When I boot my laptop with the hard drive that has this .desktop start up script it works as expected-I get a file with the hardware address info in my home folder.
But, when I place the hard drive into the mini-computer with no display and boot it, let it run for 5 minutes, then power it down, take out drive, mount the hard drive for reading, I find no file that contains the ip output I'm looking for.
Any ideas on how I can get this to work?