add url check
This commit is contained in:
parent
9ff3fac39d
commit
f9f5ce8180
1 changed files with 9 additions and 0 deletions
9
setup-key.sh
Normal file → Executable file
9
setup-key.sh
Normal file → Executable file
|
@ -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}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue