linkpi_firmware_history/rootfs/link/shell/ndi.sh

13 lines
511 B
Bash
Raw Normal View History

2024-02-15 22:07:30 +01:00
ip=`cat /link/config/net.json | grep -o '"ip":[0-9|.|"| ]*' | awk -F\" '{print $4}'`
echo $ip > /etc/hostname
hostname -F /etc/hostname
if [ -f "/link/config/mac" ]; then
sed -i "s/host-name=.*/host-name=`cat /link/config/mac`/g" /etc/avahi/avahi-daemon.conf
else
sed -i "s/host-name=.*/host-name=test/g" /etc/avahi/avahi-daemon.conf
fi
rm /usr/local/var/run/dbus/pid
rm /run/avahi-daemon/pid
/link/bin/dbus-daemon --config-file=/etc/dbus-1/system.conf
/link/bin/avahi-daemon -f /etc/avahi/avahi-daemon.conf -D