Update shm_actions_script.sh

This commit is contained in:
DaNuk (DNk) 2023-05-15 09:52:16 +03:00 committed by GitHub
parent d341994c5e
commit faaa4e1769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,15 +24,7 @@ case $EVENT in
echo "ERROR: set variable 'host_name' to server settings" echo "ERROR: set variable 'host_name' to server settings"
exit 1 exit 1
fi fi
echo "Check domain: $API_URL"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $API_URL/shm/v1/test)
if [ $HTTP_CODE -ne '200' ]; then
echo "ERROR: incorrect API URL: $API_URL"
echo "Got status: $HTTP_CODE"
exit 1
fi
echo "Install required packages" echo "Install required packages"
apt update apt update
apt install -y \ apt install -y \
@ -41,7 +33,16 @@ case $EVENT in
wireguard \ wireguard \
wireguard-tools \ wireguard-tools \
qrencode \ qrencode \
curl \
wget wget
echo "Check domain: $API_URL"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $API_URL/shm/v1/test)
if [ $HTTP_CODE -ne '200' ]; then
echo "ERROR: incorrect API URL: $API_URL"
echo "Got status: $HTTP_CODE"
exit 1
fi
if [[ $CURL_REPO && ! -f $CURL ]]; then if [[ $CURL_REPO && ! -f $CURL ]]; then
echo "Install modern curl" echo "Install modern curl"