fix(packaging): prioritize standalone Linux_Client.bin binary over shell installer and add Hub auto-download fallback
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m46s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m46s
This commit is contained in:
@@ -31,16 +31,46 @@ echo "[+] Installing LOGAR Client..."
|
||||
mkdir -p "${INSTALL_DIR}" "${CONFIG_DIR}/certs"
|
||||
chmod 700 "${CONFIG_DIR}/certs"
|
||||
|
||||
if [ -f "dist/Linux_Client.bin" ]; then
|
||||
BIN_INSTALLED=0
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
if [ -f "${SCRIPT_DIR}/Linux_Client.bin" ]; then
|
||||
cp "${SCRIPT_DIR}/Linux_Client.bin" "${INSTALL_DIR}/Linux_Client"
|
||||
BIN_INSTALLED=1
|
||||
elif [ -f "${SCRIPT_DIR}/Linux_Client" ]; then
|
||||
cp "${SCRIPT_DIR}/Linux_Client" "${INSTALL_DIR}/Linux_Client"
|
||||
BIN_INSTALLED=1
|
||||
elif [ -f "dist/Linux_Client.bin" ]; then
|
||||
cp dist/Linux_Client.bin "${INSTALL_DIR}/Linux_Client"
|
||||
BIN_INSTALLED=1
|
||||
elif [ -f "dist/Linux_Client" ]; then
|
||||
cp dist/Linux_Client "${INSTALL_DIR}/Linux_Client"
|
||||
else
|
||||
echo "[!] Warning: dist/Linux_Client binary not found in current directory. Continuing with existing binary if present."
|
||||
BIN_INSTALLED=1
|
||||
elif [ -f "Linux_Client.bin" ]; then
|
||||
cp Linux_Client.bin "${INSTALL_DIR}/Linux_Client"
|
||||
BIN_INSTALLED=1
|
||||
elif [ -f "Linux_Client" ]; then
|
||||
cp Linux_Client "${INSTALL_DIR}/Linux_Client"
|
||||
BIN_INSTALLED=1
|
||||
fi
|
||||
|
||||
if [ -f "${INSTALL_DIR}/Linux_Client" ]; then
|
||||
# If binary is not available locally, fetch standalone binary from LOGAR Hub
|
||||
if [ "${BIN_INSTALLED}" -eq 0 ] && [ ! -f "${INSTALL_DIR}/Linux_Client" ]; then
|
||||
echo "[*] Client binary not found locally. Fetching standalone Linux client binary from LOGAR Hub (${HUB_URL}/api/client/update/download?os=linux)..."
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -fsSL "${HUB_URL}/api/client/update/download?os=linux" -o "${INSTALL_DIR}/Linux_Client" || true
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -qO "${INSTALL_DIR}/Linux_Client" "${HUB_URL}/api/client/update/download?os=linux" || true
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "${INSTALL_DIR}/Linux_Client" ] && [ -s "${INSTALL_DIR}/Linux_Client" ]; then
|
||||
chmod +x "${INSTALL_DIR}/Linux_Client"
|
||||
echo "[+] Standalone Linux Client executable installed at ${INSTALL_DIR}/Linux_Client"
|
||||
else
|
||||
echo "[-] Error: Failed to acquire LOGAR Linux client executable binary." >&2
|
||||
echo "[-] Please provide Linux_Client.bin in the installer directory or verify HUB_URL connectivity." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Bootstrap certificate if missing and enrollment secret is provided
|
||||
|
||||
Reference in New Issue
Block a user