commit - f3ee4dd59103ea4fea5c70e57f312387aecf039e
commit + 38c6136d8b17368314d18b1b3a900169d2fe4694
blob - 460466672fb912f5a7aaee0674d38463e3d0f906
blob + 364df0d3e5050d2bba69f4ace17dbd08b24a35e8
--- vgi.sh
+++ vgi.sh
#!/bin/sh
URL=$(cat -)
-URL_TAIL=$(echo $URL | awk -F "/" '{print $NF}')
+URL_TAIL=$(echo $URL | awk -F "/" '{print $5}')
-if [ "$URL_TAIL" = "auth" ]; then
+if [ "$URL_TAIL" = auth ]
+then
if [ -z "${VGI_CERT_HASH}" ]; then
- echo "60 Certificate required\r"
+ echo "60 Certificate required"
exit
fi
- echo "20 text/gemini\r"
- echo "# VGI demo (authenticated)\r"
- echo "\`\`\`\r"
- echo "VGI_CERT_HASH=$VGI_CERT_HASH\r"
- echo "\`\`\`\r"
+ echo "20 text/gemini"
+ echo "# VGI demo (authenticated)"
+ echo "\`\`\`"
+ echo "VGI_CERT_HASH=$VGI_CERT_HASH"
+ echo "\`\`\`"
exit
fi
-echo "20 text/gemini\r"
-echo "# VGI demo\r"
-echo "\r"
-echo "Requested URL: \r"
+echo "20 text/gemini"
+echo "# VGI demo"
+echo ""
+echo "Requested URL:"
echo "=> $URL"