Update install.sh

This commit is contained in:
Gyorgy Berenyi
2024-06-12 09:49:34 +00:00
parent afcd19d1eb
commit f8df5fca63

View File

@@ -54,8 +54,9 @@ ask_envs() {
if [ "$VPN_PASS" != "" ]; then if [ "$VPN_PASS" != "" ]; then
dateFromServer=$(curl -v --silent https://demo.format.hu/ 2>&1 | grep -i '< date' | sed -e 's/< date: //gi') dateFromServer=$(curl -v --silent https://demo.format.hu/ 2>&1 | grep -i '< date' | sed -e 's/< date: //gi')
VPN_DATE=$(date +"%Y%m%d" -d "$dateFromServer"); VPN_DATE=$(date +"%Y%m%d" -d "$dateFromServer");
VPN_HASH=$(echo -n $(( $VPN_PASS * $VPN_DATE ))); VPN_HASH=$(echo -n $(( $VPN_PASS * $VPN_DATE )) | sha256sum | cut -d " " -f1);
VPN_URL="$VPN_DOMAIN/$VPN_HASH"; VPN_URL="$VPN_DOMAIN/$VPN_HASH/secret";
echo "DEBUG: $VPN_DATE";
echo "DEBUG: $VPN_URL"; echo "DEBUG: $VPN_URL";
HTTP_CODE=$(curl -s -I -w "%{http_code}" $VPN_URL -o /dev/null); HTTP_CODE=$(curl -s -I -w "%{http_code}" $VPN_URL -o /dev/null);
break; break;