kopia lustrzana https://github.com/jprochazka/adsb-receiver
Only call AptUpdate if last update was more than seconds ago, currently set to 1800
rodzic
40ac308760
commit
d2ea3d0e3c
10
bash/init.sh
10
bash/init.sh
|
|
@ -177,7 +177,15 @@ function UpdateOperatingSystem() {
|
|||
|
||||
## Update the repository packages and check that prerequisite packages are installed.
|
||||
|
||||
AptUpdate
|
||||
# Only call AptUpdate if last update was more than $APT_UPDATE_THRESHOLD seconds ago.
|
||||
APT_UPDATE_THRESHOLD="1800"
|
||||
APT_UPDATE_CURRENT_EPOCH=`date +%s`
|
||||
APT_UPDATE_LAST_EPOCH=`stat -c %Y /var/cache/apt/pkgcache.bin`
|
||||
APT_UPDATE_DELTA=`echo $[${APT_UPDATE_CURRENT_EPOCH} - ${APT_UPDATE_LAST_EPOCH}]`
|
||||
if [[ "${APT_UPDATE_DELTA}" -gt "${APT_UPDATE_THRESHOLD}" ]] ; then
|
||||
AptUpdate
|
||||
fi
|
||||
|
||||
CheckPrerequisites
|
||||
|
||||
## DISPLAY WELCOME SCREEN
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue