#!/bin/sh # Dieses Skript ersetzt diejenigen Konfigurationsdateien mit der bisher aktiven Version, # wenn diese kompatibel sind. D.h. SIE HABEN DIESELBE MEMBERREVISION! # MUSS FÜR JEDE NEUE FIRMWARE GGF. ERWEITERT WERDEN! # Json Dateien im Verzeichnis default und mfu "ausklammern" RCS_LOGFILE=/var/log/merger.log SOURCE_PATH=$1 DST_DIR=$2 OK="replaced" NOK="unreplaced" SRC_LIST=$SOURCE_PATH/CfgList DST_LIST=$DST_DIR/CfgList echo "##############################################################################################################" >> $RCS_LOGFILE echo "Start Merging: Quelle<$SRC_LIST> Ziel<$DST_LIST>" >> $RCS_LOGFILE ls $SRC_LIST &> /dev/null if [ "$?" -ne "0" ]; then echo "Info: Quellenliste existiert nicht" >> $RCS_LOGFILE exit -1 fi ls $DST_LIST &> /dev/null if [ "$?" -ne "0" ]; then echo "Info: Zielliste existiert nicht" >> $RCS_LOGFILE exit -1 fi ############################################################################################# # plctab search_val=plctab/maxlogplcnrs.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi #---------------------------------------------------------------------------------------------- search_val=plctab/mod_optrcl.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi #--------------------------------------------------------------------------------------------- search_val=plctab/mod_tool.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi #---------------------------------------------------------------------------------------------- search_val=plctab/mod_vwXml.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi #---------------------------------------------------------------------------------------------- search_val=plctab/plcsignals.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi ############################################################################################# # srbprg cp $SOURCE_PATH/srbprg/* $DST_DIR/srbprg &> /dev/null #search_val=srbprg/prg99.lua #src_ver=`cat $SRC_LIST | grep -w $search_val | awk '{print $2}'` #dst_ver=`cat $DST_LIST | grep -w $search_val | awk '{print $2}'` #if [ "$src_ver" == "$dst_ver" ]; then # cp $SOURCE_PATH/srbprg/* $DST_DIR/srbprg &> /dev/null # echo "Info Merge: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #else #echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #fi ############################################################################################# # IPM search_val=ipm/CONFIGDEFAULT.ipm src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/ipmgateway-config.xml src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/ipmgateway-defaults.ini src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/ipmLogDB.ini src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/ipmLogger.ini src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/ipmLogTT.ini src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ipm/RTPRS_IPM.cfg src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi ############################################################################################# # Job search_val=jobs/init.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` #if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #else # echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #fi search_val=jobs/runFunctions.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/constants.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/idcodesources.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/opmodes_declare.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/wait_for_new_opmode.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/idle_en.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` #if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #else #echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #fi search_val=jobs/idle_cw.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` #if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #else # echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE #fi search_val=jobs/scancodes.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=jobs/job000.lua src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/jobs/job*.lua $DST_DIR/jobs &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else if [ "$src_ver" == "" ]; then cp $SOURCE_PATH/jobs/job*.lua $DST_DIR/jobs &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi fi #files fuer Handbetrieb gekennzeichnet durch versionierte dummy Datei search_val=jobs/2/version if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/jobs/2/*.lua $DST_DIR/jobs/2 &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi #hau wech rm -f $DST_DIR/jobs/2/version ############################################################################################# # wlan # Zertifikate cp $SOURCE_PATH/wlan/cert/* $DST_DIR/wlan/cert &> /dev/null search_val=wlan.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else if [ "$src_ver" == "1.24" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null chmod +w $DST_DIR/$search_val sed '/\"dns\":/a \"garp\": true,' $DST_DIR/$search_val echo "$OK: $search_val convert to dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi fi ############################################################################################# # Sonstige search_val=auth.sq3 src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=guiconfig.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$OK merging: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /etc/fwupdate/merge.py $SOURCE_PATH $DST_DIR fi search_val=OkNokCntCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=OkNokCntCfg2.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=OpenPrtclCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=oppLogger.ini src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=QCode.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResSrv.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResFtpCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResHttpCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResNfsCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResNxsdCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE /home/tool/bin/ConfigUpdater $DST_DIR/$search_val $dst_ver $SOURCE_PATH/$search_val $src_ver fi search_val=ResTransferFtp.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResTransferHttp.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResTransferNfs.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResTransferNxsd.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResStorageFtp.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResStorageHttp.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResStorageNfs.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=ResStorageNxsd.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=scanAssign.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=scanCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=SE-955_PrgCmds.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=Signaling.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=timezone src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=SecSrv.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi search_val=vwXmlCfg.json src_ver=`cat $SRC_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` dst_ver=`cat $DST_LIST | grep -v "default" | grep -v "mfu" | grep -w $search_val | awk '{print $2}'` if [ "$src_ver" == "$dst_ver" ]; then cp $SOURCE_PATH/$search_val $DST_DIR/$search_val &> /dev/null echo "$OK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE else echo "$NOK: $search_val src<$src_ver> dst<$dst_ver>" >> $RCS_LOGFILE fi # NTP cp $SOURCE_PATH/ntp.cfg $DST_DIR/ntp.cfg &> /dev/null if [ "$?" -eq "0" ]; then echo "$OK: ntp.cfg" >> $RCS_LOGFILE else echo "$NOK: ntp.cfg does not exist" >> $RCS_LOGFILE fi sync echo 3 > /proc/sys/vm/drop_caches exit 0