#!/bin/sh # Synchronisierung von Config Dateien eines Nachbarn-Nexo loggerName=export-config.sh GetFwVersion="cat /etc/version" OwnFWVersion=`cat /etc/version` OPT="-avzL --exclude=default --exclude=langs --exclude=log --exclude=mfu --exclude=ChanCfg.json --exclude=CfgList -e" ls -al /etc/sync/neighbor_list &> /dev/null if [ $? -eq 0 ]; then limit=`cat /etc/sync/neighbor_list | grep -w count | awk '{print $2}'` /usr/bin/logger -s -t $loggerName "Info: Anzahl Nexos <$limit>" var0=1 while [ "$var0" -le "$limit" ] do addr=`cat /etc/sync/neighbor_list | grep $var0: | awk '{print $2}'` Neighbour_Version=`/usr/bin/dbclient -t -y -i /home/tool/.ssh/did_rsa root@$addr "$GetFwVersion" < /dev/ptmx` if [ "$Neighbour_Version" == "$OwnFWVersion" ]; then logger -s -t $loggerName "Info: Firmware Version gleich" usr/bin/rsync $OPT /mnt/data/config/$OwnFWVersion "dbclient -y -i /home/tool/.ssh/did_rsa" root@$neighbor_Nexo:/home/tool/config/ else logger -s -t $loggerName "Err: Missmatch Firmware Version! Nexo <$addr:$Neighbour_Version> Own <$OwnFWVersion>" fi var0=`expr $var0 + 1` done fi exit 0