infrastructure/scripts/export_secret.sh

14 lines
391 B
Bash
Raw Permalink Normal View History

# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
DECRYPT=()
if [ -f "$HOME/.ssh/id_rsa" ]; then
DECRYPT+=(-i "$HOME/.ssh/id_rsa")
fi
if [ -f "$HOME/.ssh/id_ed25519" ]; then
DECRYPT+=(-i "$HOME/.ssh/id_ed25519")
fi
export RADIUS_SECRET=$(rage "${DECRYPT[@]}" -d ./machines/nixos/vault01/secrets/radius-ap-radius-secret_file)