#!/bin/sh loggerName=system-reset.sh RdyFlagSet="dbus-send --system --print-reply --dest=com.rexroth.akku.SysService /SysObj com.rexroth.akku.SysInterface.frdyflagset int32:7" RdyFlagResetSet="dbus-send --system --print-reply --dest=com.rexroth.akku.SysService /SysObj com.rexroth.akku.SysInterface.frdyflagreset int32:7" CONFIG_DIR=/home/tool/config DEFAULT_DIR=$CONFIG_DIR/default ls $DEFAULT_DIR &> /dev/null if [ $? -eq 1 ];then logger -s -t $loggerName "error missing default dir" exit 1 fi $RdyFlagResetSet rm -fr $CONFIG_DIR/ipm cp -rf $DEFAULT_DIR/ipm $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced ipm-directory" fi rm -fr $CONFIG_DIR/jobs cp -rf $DEFAULT_DIR/jobs $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced jobs-directory" fi rm -fr $CONFIG_DIR/plctab cp -rf $DEFAULT_DIR/plctab $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced plctab-directory" fi rm -fr $CONFIG_DIR/srbprg cp -rf $DEFAULT_DIR/srbprg $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced srbprg-directory" fi rm -fr $CONFIG_DIR/wlan cp -rf $DEFAULT_DIR/wlan $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced wlan-directory" fi cp -f $DEFAULT_DIR/*.json $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced *.json" fi cp /etc/init.d/web2py_normal.sh /etc/init.d/web2py.sh if [ $? -eq 0 ];then logger -s -t $loggerName "replaced /etc/init.d/web2py.sh" fi cp -f $DEFAULT_DIR/auth.sq3 $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced auth.sq3" fi cp -f $DEFAULT_DIR/oppLogger.ini $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced oppLogger.ini" fi cp -f $DEFAULT_DIR/timezone $CONFIG_DIR if [ $? -eq 0 ];then logger -s -t $loggerName "replaced timezone" fi rm /mnt/data/ResDB.sq3 if [ $? -eq 0 ];then logger -s -t $loggerName "removed ResDB.sq3" fi logger -s -t $loggerName "create default configuration -> Reboot System" /etc/reboot/reboot.sh & exit 0