Browse Source

check repositories update time

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

5
src/main

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

Loading…
Cancel
Save