Merge branch 'stable' into devel
[tails.git] / bin / bump-APT-snapshots-expiration-date
blob7fa6864a0ac8369f9f6afd75387ed69c9a338913
1 #!/bin/bash
3 set -eu
4 set -x
6 error () {
7 echo "error: ${*}" >&2
8 exit 1
11 USAGE="Usage: $(basename "$0") DAYS_FROM_NOW"
13 [ $# -eq 1 ] || error "$USAGE"
15 DAYS_FROM_NOW="$1"
17 for dir in config/APT_snapshots.d vagrant/definitions/tails-builder/config/APT_snapshots.d; do
19 set -eu
20 set -x
21 cd "${dir}"
22 for ARCHIVE in * ; do
23 if ! grep -qs '^latest$' "$ARCHIVE"/serial; then
24 # shellcheck disable=SC2029
25 ssh reprepro-time-based-snapshots@incoming.deb.tails.boum.org \
26 tails-bump-apt-snapshot-valid-until \
27 "$ARCHIVE" "$(cat "$ARCHIVE"/serial)" \
28 "${DAYS_FROM_NOW:?}"
30 done
32 done