Restructure start script, extract provider specific scripts and add support for fetching configs from URL

This commit is contained in:
Kristian Haugene
2020-08-23 19:45:05 +02:00
parent ca79ee1e13
commit 5a511d6d9e
6 changed files with 120 additions and 90 deletions

View File

@@ -0,0 +1,15 @@
#! /bin/bash
pwd_url=$(curl -s "https://www.vpnbook.com/freevpn" | grep -m2 "Password:" | tail -n1 | cut -d \" -f2)
curl -s -X POST --header "apikey: 5a64d478-9c89-43d8-88e3-c65de9999580" \
-F "url=https://www.vpnbook.com/${pwd_url}" \
-F 'language=eng' \
-F 'isOverlayRequired=true' \
-F 'FileType=.Auto' \
-F 'IsCreateSearchablePDF=false' \
-F 'isSearchablePdfHideTextLayer=true' \
-F 'scale=true' \
-F 'detectOrientation=false' \
-F 'isTable=false' \
"https://api.ocr.space/parse/image" -o /tmp/vpnbook_pwd
export OPENVPN_PASSWORD=$(cat /tmp/vpnbook_pwd | awk -F',' '{ print $1 }' | awk -F':' '{print $NF}' | tr -d '"')