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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#!/bin/sh
set -e
dump_source="${1:-https://pgp.key-server.io/sks-dump/}"
if [ "$(id -un)" != debian-sks ]; then
printf "SKS db setup script (%s) should only be run by debian-sks user\n" "$0" >&2
exit 1
fi
for dbloc in /var/lib/sks/DB /var/lib/sks/PTree; do
if [ -e "$dbloc" ]; then
printf "Database location %s is already present; you have probably already set up SKS.\nAborting %s\n" "$dbloc" "$0" >&2
exit 1
fi
done
if ls /var/lib/sks/dump/*.pgp 2>/dev/null >/dev/null; then
printf "It looks like a keydump has already been fetched, so we will skip that part.\nIf you want a fresh keydump, remove the following files and re-run %s\n" "$0" >&2
ls /var/lib/sks/dump/*.pgp >&2
else
printf "Fetching keydump from %s to /var/lib/sks/dump...\n" "$dump_source"
(cd /var/lib/sks/dump &&
wget --quiet --recursive --no-parent --no-directories \
--accept pgp --execute robots=off "$dump_source")
fi
/usr/lib/sks/sks_build.sh --normal
cat >&2 <<EOF
The sks database is now configured but the daemons aren't yet running!
EOF
if [ -d /run/systemd/system ]; then
cat >&2 <<EOF
You appear to be using systemd.
You can start the daemons with:
systemctl start sks
and you can enable them permanently (so that they start automatically
at every boot) with:
systemctl enable sks
EOF
else
cat >&2 <<EOF
It looks like you're using SysV init or something similar
(and not using systemd).
You can start the daemons with:
service sks start
and you can enable them permanently (so that they start automatically
at every boot) with:
update-rc.d sks enable
EOF
fi
cat >&2 <<EOF
If you're using SKS on the public Internet, please subscribe to the
operators mailing list <sks-devel@nongnu.org>
(https://lists.nongnu.org/mailman/listinfo/sks-devel/) and read the
current advice on server configuration:
https://github.com/SKS-Keyserver/sks-keyserver/wiki/Peering
EOF
|