forked from freifunk-franken/firmware
Sync Hostname everytime with nodewatcher, fixed small bug in tincstart
This commit is contained in:
parent
5f4bdffc34
commit
cff6d5a1e2
|
@ -441,6 +441,17 @@ crawl() {
|
|||
if [ $error_level -gt "1" ]; then
|
||||
echo "`date`: Das Senden der Statusdaten war nach dem `expr $i + 1`. Mal erfolgreich" >> $logfile
|
||||
fi
|
||||
|
||||
netmon_hostname="`echo $api_return | cut '-d;' -f2`"
|
||||
if [ "$netmon_hostname" != "`cat /proc/sys/kernel/hostname`" ]; then
|
||||
if [ $error_level -gt "1" ]; then
|
||||
echo "`date`: Setze neuen Hostname (Hostname synchronisation)" >> $logfile
|
||||
fi
|
||||
uci set system.@system[0].hostname=$netmon_hostname
|
||||
uci commit
|
||||
echo $netmon_hostname > /proc/sys/kernel/hostname
|
||||
fi
|
||||
|
||||
break;
|
||||
else
|
||||
if [ $error_level -gt "0" ]; then
|
||||
|
|
|
@ -19,10 +19,12 @@ then
|
|||
hostname=$(cat /proc/sys/kernel/hostname)
|
||||
|
||||
if [ "$hostname" == "OpenWrt" ]
|
||||
then
|
||||
hostname=""
|
||||
fi
|
||||
|
||||
if [ "$hostname" == "" ]
|
||||
then
|
||||
hostname=$(ifconfig br-mesh | grep HWaddr | awk '{ print $5 }'|sed -e 's/://g')
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue