kopia lustrzana https://github.com/jprochazka/adsb-receiver
Move DELAY function to bash/functions.sh
rodzic
56ee20aac5
commit
d2c5da66ea
|
|
@ -31,7 +31,7 @@
|
|||
# #
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
#######################################################################
|
||||
#################################################################################
|
||||
# Detect if a package is installed and if not attempt to install it.
|
||||
|
||||
function CheckPackage {
|
||||
|
|
@ -107,6 +107,7 @@ function UncommentConfig {
|
|||
sudo sed -i -e "/$1/s/^#//" $2
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# The following function is used to clean up the log files by removing
|
||||
# any color escaping sequences from the log file so it is easier to read.
|
||||
# There are other lines not needed which can be removed as well.
|
||||
|
|
@ -117,3 +118,19 @@ function CleanLogFile {
|
|||
# Remove the "Press enter to continue..." lines from the log file.
|
||||
sed -i "/Press enter to continue.../d" $1
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Add a pseudo-random delay of between 5 and 59 minutes
|
||||
|
||||
function RandomDelay() {
|
||||
if [[ ${DELAY} = "true" ]] ; then
|
||||
DELAY_TIME=`echo "(( 300 + ( $RANDOM + $RANDOM )) / 20 )" | bc`
|
||||
DATE=`date`
|
||||
echo -e ""
|
||||
echo -e "\e[91m $ADSB_PROJECTTITLE"
|
||||
echo -e ""
|
||||
echo -en "\e[92m Pausing for ${DELAY_TIME} seconds from: \t\e[39m $DATE"
|
||||
echo -e ""
|
||||
sleep $DELAY_TIME
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
17
bash/init.sh
17
bash/init.sh
|
|
@ -93,6 +93,7 @@ function AptUpdate() {
|
|||
fi
|
||||
}
|
||||
|
||||
# CHECK PREREQUISITES
|
||||
function CheckPrerequisites() {
|
||||
clear
|
||||
echo -e "\n\e[91m $ADSB_PROJECTTITLE"
|
||||
|
|
@ -111,8 +112,8 @@ function CheckPrerequisites() {
|
|||
fi
|
||||
}
|
||||
|
||||
# UPDATE THIS REPOSITORY
|
||||
function UpdateRepository() {
|
||||
### UPDATE THIS REPOSITORY
|
||||
clear
|
||||
echo -e "\n\e[91m $ADSB_PROJECTTITLE"
|
||||
echo ""
|
||||
|
|
@ -153,20 +154,6 @@ function UpdateOperatingSystem() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Add a pseudo-random delay of between 5 and 59 minutes
|
||||
function RandomDelay() {
|
||||
if [[ ${DELAY} = "true" ]] ; then
|
||||
DELAY_TIME=`echo "(( 300 + ( $RANDOM + $RANDOM )) / 20 )" | bc`
|
||||
DATE=`date`
|
||||
echo -e ""
|
||||
echo -e "\e[91m $ADSB_PROJECTTITLE"
|
||||
echo -e ""
|
||||
echo -en "\e[92m Pausing for ${DELAY_TIME} seconds from: \t\e[39m $DATE"
|
||||
echo -e ""
|
||||
sleep $DELAY_TIME
|
||||
fi
|
||||
}
|
||||
|
||||
RandomDelay
|
||||
AptUpdate
|
||||
CheckPrerequisites
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue