update-aptsec.sh 429 B

123456789101112131415161718192021
  1. #!/bin/bash -e
  2. dir=/srv/http/htdocs/apt-sec
  3. action="$1"
  4. cd $dir
  5. [ "A$action" = "Ainit" ] && rm -f $dir/cache/* || true
  6. # signal that we're updating apt-sec cache
  7. lockfile-create /var/lock/aptsec-update
  8. lockfile-touch /var/lock/aptsec-update &
  9. BADGER2="$!"
  10. ./apt-sec update |grep -v ^Adding |tee apt-sec.log
  11. echo -n "$(date +%x\ %R): Done synching apt-sec caches"
  12. kill "${BADGER2}"
  13. lockfile-remove /var/lock/aptsec-update