overthesun / simoc-sam

Live backend for SAM at Biosphere 2
2 stars 1 forks source link

Add the `fix-ip` command. #67

Closed ezio-melotti closed 6 months ago

ezio-melotti commented 6 months ago

This command checks that the IP address of the bat0 interface (e.g. 172.27.0.5) matches the hostname (e.g. samrpi5). If they don't match, it will update the IP in the /etc/network/interfaces.d/bat0 file and restart the RPi.

This command is also meant to be run on boot by adding python3 /home/pi/simoc-sam/simoc-sam.py fix-ip to /etc/rc.local, for two reasons:

Eventually the start-batman-adv.sh script could be merged/combined with this command too.