13 lines
511 B
Bash
13 lines
511 B
Bash
|
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
|