Commit 4a4cc0b9 authored by Štěpán Henek's avatar Štěpán Henek 🐻

server-uplink: get registration code fix

parent 07d3716c
......@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=server-uplink
PKG_VERSION:=2
PKG_VERSION:=3
PKG_MAINTAINER:=Stepan Henek <stepan.henek@nic.cz>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
......
......@@ -27,6 +27,11 @@ OUTPUT_FILE=/usr/share/server-uplink/registration_code
CODE=$(curl -s -k -m $TIMEOUT "$CHALLENGE_URL" | atsha204cmd challenge-response | head -c 16)
if [ -z "$CODE" ] ; then
logger -t server_uplink -p error "Failed to get registration code"
exit 1
fi
# test whether the code is the same
if [ -f "$OUTPUT_FILE" ] ; then
if [ "$CODE" == "$(cat "$OUTPUT_FILE")" ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment