mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 05:57:04 +04:00
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:
1 parent
09bf3f2e6b
commit
13ac2fde62
1 file changed
+8
@@ -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
|
||||
|
||||
Reference in new issue
Block a user