#! /bin/sh

. ./function.sh

ClearEeprom;
ShowStartInstall;

Return=$(SetStaticIP);
if [ $Return -eq -1 ]; then
    ShowNetworkConnectionError;
    Beep 4 0.001 0.5;
    exit 0;
fi

Beep 1 1 0.001;
ClearApp;
RemoveApp;
CopyFactoryFileToEnvironment;

Return=$(ComparisonFactoryTarFile);
if [ $Return -eq -1 ]; then
    ShowComparisonTarFileError;
    Beep 4 0.001 0.5;
    exit 0;
fi

DecompressedFile;
CopyEnvironment;
SetEnvironment;
ChmodFile;
DeleteResidualFile;
DeleteFactoryResidualFile;
Sync;
SetEeprom "Restore";
/Init/Device_Driver/Multi_ComPort_driver.sh;
ShowInstallSuccess;
Beep 1 1 0.5;
Beep 1 1 0.001;
