-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
29 lines (23 loc) · 1.15 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -eo pipefail
set -x
case $1 in
post-install)
echo -e "\nINSTALLED KEYRING SHOULD MATCH ONLINE COPY:"
wget -qO- https://packages.nlnetlabs.nl/aptkey.asc | gpg --dearmor | diff -q /usr/share/keyrings/nlnetlabs-archive-keyring.gpg -
# define $ID, which is 'debian', 'ubuntu', ..
. /etc/os-release
echo -e "\nAPT UPDATE SHOULD FAIL TO AUTHENTICATE WITHOUT SIGNED-BY LINE:"
echo "deb [arch=$(dpkg --print-architecture)] https://packages.nlnetlabs.nl/linux/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/nlnetlabs.list
! apt-get update -o Debug::Acquire::gpgv=1
echo -e "\nAPT UPDATE SHOULD SUCCEED TO AUTHENTICATE WITH SIGNED-BY LINE:"
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/nlnetlabs-archive-keyring.gpg] \
https://packages.nlnetlabs.nl/linux/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/nlnetlabs.list
apt-get update -o Debug::Acquire::gpgv=1
# when debugging -o Debug::Acquire::https=1 may prove useful too
echo -e "\nAPT INSTALL SHOULD NOW WORK:"
apt-get install --simulate --yes routinator
;;
post-upgrade)
;;
esac