Browse Source

check repositories update time

bookworm
pvincent 3 years ago
parent
commit
aa5f193cc4
  1. 7
      src/main

7
src/main

@ -66,7 +66,12 @@ REQUIRED_PACKAGES=( \
echo "# updating repositories" echo "# updating repositories"
echo "===================" echo "==================="
sudo apt update
if [[ $(date --date='-12 hours' +%s) -gt $(date -d "$(stat -c %y /var/lib/apt/lists/partial)" +%s) ]]; then
sudo apt update
sudo apt autoremove -y
else
echo "repositories recently updated!"
fi
echo "# required packages" echo "# required packages"

Loading…
Cancel
Save