From f9f5ce818057157fcd8c5b3f967dd161b9efd7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 19 Oct 2023 13:50:47 +0200 Subject: [PATCH] add url check --- setup-key.sh | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100644 => 100755 setup-key.sh diff --git a/setup-key.sh b/setup-key.sh old mode 100644 new mode 100755 index e8abb92..507bd47 --- a/setup-key.sh +++ b/setup-key.sh @@ -28,6 +28,15 @@ if [ -e "${KEYFILE}" ]; then exit 1 fi +URL="https://git.abstractnonsen.se/${OWNER}/${REPOSITORY}" +if curl --output /dev/null --silent --head --fail "${URL}"; then + read -p -n 1 -r "Url ${URL} is not (publicly) accessible, are you sure you want to continue? [y/N] " + echo + if [[ ! $REPLY =~ ^[Yy]$ ]] + exit 1 + fi +fi + mkdir -p "${KEY_DIR}" chmod 700 "${KEY_DIR}"