61-beta3
This commit is contained in:
+19
-4
@@ -71,6 +71,7 @@ function handleSleep() {
|
|||||||
writeToLog "sleeping ${sleepMins} minutes"
|
writeToLog "sleeping ${sleepMins} minutes"
|
||||||
sleep $sleepSecs
|
sleep $sleepSecs
|
||||||
returnStatus
|
returnStatus
|
||||||
|
sleepChk=$?
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCheckInstallPackages() {
|
function handleCheckInstallPackages() {
|
||||||
@@ -105,6 +106,7 @@ function handleCustomBins() {
|
|||||||
writeToLog "deleting ${customBinLocation}"
|
writeToLog "deleting ${customBinLocation}"
|
||||||
rm -rf $customBinLocation
|
rm -rf $customBinLocation
|
||||||
returnStatus
|
returnStatus
|
||||||
|
rmCustomBinChk=$?
|
||||||
else
|
else
|
||||||
writeToLog "${customBinLocation} not found, skipping delete\n"
|
writeToLog "${customBinLocation} not found, skipping delete\n"
|
||||||
fi
|
fi
|
||||||
@@ -112,10 +114,12 @@ function handleCustomBins() {
|
|||||||
writeToLog "copying scripts from ${customBinFrom} to ${customBinLocation}"
|
writeToLog "copying scripts from ${customBinFrom} to ${customBinLocation}"
|
||||||
cp -r $customBinFrom $customBinLocation
|
cp -r $customBinFrom $customBinLocation
|
||||||
returnStatus
|
returnStatus
|
||||||
|
cpCustomBinChk=$?
|
||||||
|
|
||||||
writeToLog "making scripts executable at ${customBinLocation}"
|
writeToLog "making scripts executable at ${customBinLocation}"
|
||||||
chmod -R +x $customBinLocation
|
chmod -R +x $customBinLocation
|
||||||
returnStatus
|
returnStatus
|
||||||
|
customBinExecChk=$?
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
@@ -127,16 +131,19 @@ function handleExport() {
|
|||||||
writeToLog "backing up $exportScript to $exportBackupScript"
|
writeToLog "backing up $exportScript to $exportBackupScript"
|
||||||
cp -f $exportScript $exportBackupScript
|
cp -f $exportScript $exportBackupScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
backupExportScriptChk=$?
|
||||||
else
|
else
|
||||||
writeToLog "testExport export is set\n"
|
writeToLog "testExport export is set\n"
|
||||||
|
|
||||||
writeToLog "deleting $exportScript"
|
writeToLog "deleting $exportScript"
|
||||||
rm -f $exportScript
|
rm -f $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
rmExportScriptChk=$?
|
||||||
|
|
||||||
writeToLog "restoring $exportScript from backup at $exportBackupScript"
|
writeToLog "restoring $exportScript from backup at $exportBackupScript"
|
||||||
cp $exportBackupScript $exportScript
|
cp $exportBackupScript $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
restoreExportScriptChk=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
writeToLog "adding $runningDir/add-to-export-sh.txt to $exportScript"
|
writeToLog "adding $runningDir/add-to-export-sh.txt to $exportScript"
|
||||||
@@ -174,6 +181,7 @@ function handleSetupEnvironment() {
|
|||||||
writeToLog "creating $installDir"
|
writeToLog "creating $installDir"
|
||||||
mkdir $installDir
|
mkdir $installDir
|
||||||
returnStatus
|
returnStatus
|
||||||
|
mkInstallDirChk=$?
|
||||||
else
|
else
|
||||||
writeToLog "$installDir exisits, skiping creation\n"
|
writeToLog "$installDir exisits, skiping creation\n"
|
||||||
fi
|
fi
|
||||||
@@ -188,6 +196,7 @@ function handleSetupEnvironment() {
|
|||||||
writeToLog "$espressifLocation fonud, deleting for reinstall"
|
writeToLog "$espressifLocation fonud, deleting for reinstall"
|
||||||
rm -rf $espressifLocation
|
rm -rf $espressifLocation
|
||||||
returnStatus
|
returnStatus
|
||||||
|
rmEspressifChk=$?
|
||||||
else
|
else
|
||||||
writeToLog "$espressifLocation not found, skipping delete for reinstall\n"
|
writeToLog "$espressifLocation not found, skipping delete for reinstall\n"
|
||||||
fi
|
fi
|
||||||
@@ -262,6 +271,7 @@ function handleDownloadInstall() {
|
|||||||
writeToLog "deleting $idfDir"
|
writeToLog "deleting $idfDir"
|
||||||
rm -rf $idfDir
|
rm -rf $idfDir
|
||||||
returnStatus
|
returnStatus
|
||||||
|
rmIdfDirChk=$?
|
||||||
else
|
else
|
||||||
writeToLog "$idfDir not found, skipping delete\n"
|
writeToLog "$idfDir not found, skipping delete\n"
|
||||||
fi
|
fi
|
||||||
@@ -270,7 +280,7 @@ function handleDownloadInstall() {
|
|||||||
writeToLog "CLONING esp-idf, branch $gitBranch with $gitJobs jobs to $idfDir\n\tCommand: $gitCloneCmd\n"
|
writeToLog "CLONING esp-idf, branch $gitBranch with $gitJobs jobs to $idfDir\n\tCommand: $gitCloneCmd\n"
|
||||||
eval "$gitCloneCmd"
|
eval "$gitCloneCmd"
|
||||||
returnStatus
|
returnStatus
|
||||||
gitCh=$?
|
gitChk=$?
|
||||||
iendTime=$(date '+%s')
|
iendTime=$(date '+%s')
|
||||||
installerTime=$(($iendTime-$istartTime))
|
installerTime=$(($iendTime-$istartTime))
|
||||||
writeToLog "Git CLONE completed in $installerTime seconds\n"
|
writeToLog "Git CLONE completed in $installerTime seconds\n"
|
||||||
@@ -309,11 +319,13 @@ function handleDownloadInstall() {
|
|||||||
writeToLog "getting the commit hash\n"
|
writeToLog "getting the commit hash\n"
|
||||||
commitHash=$(git -C $idfDir rev-parse HEAD)
|
commitHash=$(git -C $idfDir rev-parse HEAD)
|
||||||
returnStatus
|
returnStatus
|
||||||
|
gitHashChk=$?
|
||||||
|
|
||||||
gitDataLog="$(date '+%d/%m/%Y %H:%M:%S %Z (%s)') commit $commitHash branch $gitBranch version $scriptVers action $action"
|
gitDataLog="$(date '+%d/%m/%Y %H:%M:%S %Z (%s)') commit $commitHash branch $gitBranch version $scriptVers action $action"
|
||||||
writeToLog "$gitDataLog"
|
writeToLog "$gitDataLog"
|
||||||
echo "$gitDataLog" >> $versionData
|
echo "$gitDataLog" >> $versionData
|
||||||
returnStatus
|
returnStatus
|
||||||
|
gitLogChk=$?
|
||||||
}
|
}
|
||||||
|
|
||||||
handleReboot() {
|
handleReboot() {
|
||||||
@@ -345,6 +357,7 @@ handleWarnAllUsers() {
|
|||||||
returnStatus
|
returnStatus
|
||||||
done
|
done
|
||||||
returnStatus
|
returnStatus
|
||||||
|
warnChk=$?
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,6 +379,7 @@ function handleLogoutAllUsers() {
|
|||||||
returnStatus
|
returnStatus
|
||||||
done
|
done
|
||||||
returnStatus
|
returnStatus
|
||||||
|
logoutChk=$?
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +416,7 @@ function handleStart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleEmptyLogs() {
|
function handleEmptyLogs() {
|
||||||
echo -e "\nDeleting $log\n"
|
echo -e "\n\nDeleting $log\n"
|
||||||
rm -f $log
|
rm -f $log
|
||||||
echo -e "\treturn status: ${?}\n"
|
echo -e "\treturn status: ${?}\n"
|
||||||
|
|
||||||
@@ -420,9 +434,10 @@ function handleEmptyLogs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleChk() {
|
function handleChk() {
|
||||||
retCodes="Error Checking:\n\tPackages install: $pkgInstallChk\n\tGit pull/clone: $gitChk\n\tInstall script: $installChk\n\tInstall tools: $toolsInstallChk\n\tExport append: $exportCatChk\n\tExport edit return: $exportSedReturnChk\n\tExport version: $exportSedVersionChk\n\tExport date: $exportSedDateChk\n\tExport git hash: $exportSedHashChk\n\trun_esp_reinstall alias: $aliasRunEspReinstallChk\n\tesp_monitor alias: $aliasEspMonitorchk\n\tesp_logs alias: $aliasEspLogsChk\n\tESPIDF_INSTALLDIR envvar: $aliasInstallDirChk\n"
|
retCodes="Error Checking:\n\tPackages install: $pkgInstallChk\n\tGit pull/clone: $gitChk\n\tInstall script: $installChk\n\tInstall tools: $toolsInstallChk\n\tExport append: $exportCatChk\n\tExport edit return: $exportSedReturnChk\n\tExport version: $exportSedVersionChk\n\tExport date: $exportSedDateChk\n\tExport git hash: $exportSedHashChk\n\trun_esp_reinstall alias: $aliasRunEspReinstallChk\n\tesp_monitor alias: $aliasEspMonitorchk\n\tesp_logs alias: $aliasEspLogsChk\n\tESPIDF_INSTALLDIR envvar: $aliasInstallDirChk\n\tWarned Users: $warnChk\n\tLogged out users: $logoutChk\n\tAppended git log to version-data.txt: $gitLogChk\n\tAcquired git hash: $gitHashChk\n\tDeleted esp-idf dir: $rmIdfDirChk\n\tDeleted .espressif dir: $rmEspressifChk
|
||||||
|
\n\tCreated install dir: $mkInstallDirChk\n\tRestored export.sh.bak: $restoreExportScriptChk\n\tDeleted old export.sh: $rmExportScriptCh\n\tBacked up export.sh to export.sh.bak: $backupExportScriptChk\n\tMade custom scripts executable: $customBinExecChk\n\tCopied custom scripts: $cpCustomBinChk\n\tDeleted old custom scripts dir: $rmCustomBinChk\n\tWoke from sleep: $sleepChk"
|
||||||
|
|
||||||
totalErrorLoad=$(($pkgInstallChk+$gitChk+$gitChk+$installChk+$toolsInstallChk+$exportSedHashChk+$exportCatChk+$exportSedReturnChk+$aliasRunEspReinstallChk+$aliasEspMonitorchk+$aliasEspLogsChk+$aliasInstallDirChk))
|
totalErrorLoad=$(($pkgInstallChk+$gitChk+$gitChk+$installChk+$toolsInstallChk+$exportSedHashChk+$exportCatChk+$exportSedReturnChk+$aliasRunEspReinstallChk+$aliasEspMonitorchk+$aliasEspLogsChk+$aliasInstallDirChk+$warnChk+$logoutChk+$gitLogChk+$gitHashChk+$rmIdfDirChk+$rmEspressifChk+$mkInstallDirChk+$restoreExportScriptChk+$rmExportScriptCh+$backupExportScriptChk+$customBinExecChk+$rmCustomBinChk+$sleepChk))
|
||||||
|
|
||||||
if [[ $totalErrorLoad < 2 ]]; then
|
if [[ $totalErrorLoad < 2 ]]; then
|
||||||
writeToLog "Installed Successfully, total error load: $totalErrorLoad"
|
writeToLog "Installed Successfully, total error load: $totalErrorLoad"
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
61-beta2
|
61-beta3
|
||||||
Reference in New Issue
Block a user