Hi all,
I have write a small script that allows every tinyvcore to start up with an IP static. To have this IP address the script must read mac address machine after boot.
the script is in /opt/script.sh and in my /opt/bootlocal.sh, I have this entry: /opt/script.sh &
Here is the script.
#!/bin/sh
pkill udhcpc
case 'cat /sys/class/net/eth0/address' in
52:54:00:12:34:56) IP='ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up' ;;
52:54:00:12:34:57) IP='ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up' ;;
52:54:00:12:34:58) IP='ifconfig eth0 192.168.1.3 netmask 255.255.255.0 up' ;;
52:54:00:12:34:59) IP='ifconfig eth0 192.168.1.4 netmask 255.255.255.0 up' ;;
*) IP='ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up' ;;
esac
$IP
I reboot the machines. always every machine take the last IP.... how i can to fix it?
Any recommendation very welcome, Thanks in advance