ripe-atlas: fit get_key to the installed variant

With only ripe-atlas-common installed, get_key told users to start the
probe to create the key, but the init creates it only once
ripe-atlas-probe or ripe-atlas-anchor is installed. For an anchor, it
pointed to the registration form of software probes. Say which package
is missing, and point an anchor to the anchor application.

Fixes: 21b1fefb41 ("ripe-atlas: add get_key and probeid to init script")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
This commit is contained in:
Josef Schlehofer committed 2026-10-06 20:18:20 +02:00
1 parent 09bf3f2e6b
commit 13ac2fde62
1 file changed
+8
+8
View File
@@ -256,8 +256,14 @@ registered_id()
get_key()
{
local pub=/etc/ripe-atlas/probe_key.pub
local variant
local id
variant="$(cat /usr/share/ripe-atlas/variant 2> /dev/null)"
if [ -z "${variant}" ]; then
echo 'Install ripe-atlas-probe or ripe-atlas-anchor first' >&2
return 1
fi
if [ ! -s "${pub}" ]; then
echo "${pub} is missing, start the probe to create it" >&2
return 1
@@ -265,6 +271,8 @@ get_key()
id="$(registered_id)"
if [ -n "${id}" ]; then
echo "Registered as probe ${id} with:"
elif [ "${variant}" = anchor ]; then
echo 'Register the anchor at https://atlas.ripe.net/anchors/apply/ with:'
else
echo 'Register the probe at https://atlas.ripe.net/apply/swprobe/ with:'
fi