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:
all images are flashed with the same IP, but with the correct hostname (it can be set from the Imager), so the IP needs to be updated on the first boot;
for all subsequent boots, the IP should be correct, so this command won't change anything, but it will help ensuring that the IP is still set correctly.
Eventually the start-batman-adv.sh script could be merged/combined with this command too.
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.