mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Removed apt-get update/upgrade, instead checking for updates availible and advising user to update/upgrade after installation of pi-hole. Addresses issue #218
This commit is contained in:
parent
6b76270889
commit
01d7fc0ac9
@ -293,24 +293,27 @@ stopServices(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkForDependencies(){
|
checkForDependencies(){
|
||||||
echo ":::"
|
|
||||||
#Check to see if apt-get update has already been run today
|
#Running apt-get update/upgrade with minimal output can cause some issues with
|
||||||
timestamp=$(stat -c %Y /var/cache/apt/)
|
#requiring user input (e.g password for phpmyadmin see #218)
|
||||||
timestampAsDate=$(date -d @$timestamp "+%b %e")
|
#We'll change the logic up here, to check to see if there are any updates availible and
|
||||||
|
# if so, advise the user to run apt-get update/upgrade at their own discretion
|
||||||
|
|
||||||
today=$(date "+%b %e")
|
today=$(date "+%b %e")
|
||||||
|
|
||||||
if [ ! "$today" == "$timestampAsDate" ]; then
|
echo -n "::: Checking apt-get for upgraded packages...."
|
||||||
#update package lists
|
updatesToInstall=$(sudo apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst) & spinner $!
|
||||||
echo -n "::: Updating package list before install...."
|
echo " done!"
|
||||||
$SUDO apt-get -qq update > /dev/null & spinner $!
|
|
||||||
echo " done!"
|
if [ updatesToInstall > 0 ]; then
|
||||||
echo -n "::: Upgrading installed apt-get packages...."
|
echo "::: There are $updatesToInstall updates availible for your pi!"
|
||||||
$SUDO apt-get -y -qq upgrade > /dev/null & spinner $!
|
echo "::: Please consider running 'sudo apt-get update', followed by 'sudo apt-get upgrade'"
|
||||||
echo " done!"
|
echo "::: after pi-hole has finished installing.
|
||||||
else
|
echo ":::"
|
||||||
echo "::: Apt-get update already run today, any more would be overkill..."
|
echo "::: Continuing with pi-hole installation..."
|
||||||
fi
|
else
|
||||||
|
echo "::: Your pi is up to date! Continuing with pi-hole installation..."
|
||||||
|
fi
|
||||||
|
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Checking dependencies:"
|
echo "::: Checking dependencies:"
|
||||||
|
Loading…
Reference in New Issue
Block a user