#!/bin/sh # Synchronisierung von Config Dateien eines Nachbarn-Nexo loggerName=sync_config.sh logfile=/var/log/sync.log neighbor_Nexo=$1 GetFwVersion="cat /etc/version" OwnFWVersion=`cat /etc/version` Neighbour_Version=`/usr/bin/dbclient -t -y -i /home/tool/.ssh/did_rsa root@$neighbor_Nexo "$GetFwVersion" < /dev/ptmx` OPT="-avzL --exclude=default --exclude=langs --exclude=log --exclude=mfu --exclude=ChanCfg.json --exclude=CfgList -e" if [ "$Neighbour_Version" == "$OwnFWVersion" ]; then # Firmware Version gleich logger -s -t $loggerName "Info: Firmware Version gleich" /usr/bin/rsync $OPT "dbclient -y -i /home/tool/.ssh/did_rsa" root@$neighbor_Nexo:/home/tool/config/ /mnt/data/config/$OwnFWVersion >> $logfile else logger -s -t $loggerName "Err: Firmware Version ungleich! Nachbar <$Neighbour_Version> Eigene <$OwnFWVersion>" exit -1 fi exit 0