From 1347d5ed38e01f6dd997959cb1f4317cc2aaea96 Mon Sep 17 00:00:00 2001 From: Steffen Taubenheim-Probst Date: Fri, 25 Jun 2021 23:21:43 +0200 Subject: [PATCH] dynamischer Hostname anhand der Mac-Adresse --- etc/rc.local | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etc/rc.local b/etc/rc.local index 1407c0f..f3fe6a1 100755 --- a/etc/rc.local +++ b/etc/rc.local @@ -21,9 +21,12 @@ if [ "$_IP" ]; then fi # set hostname -if [ -f /boot/client-cfg/hostname.txt ]; then - hostname --file /boot/client-cfg/hostname.txt -fi +#if [ -f /boot/client-cfg/hostname.txt ]; then +# hostname --file /boot/client-cfg/hostname.txt +#fi + +#Hostname wird anhand des WLAN0 erstell / kann auch entsprechend auf anderes Geraet umgestellt werden +echo rpi$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname # set network