Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #sets script dir as working dir
- cd "$(dirname "$0")"
- PIA_CERT="ca.rsa.4096.crt"
- PIA_TOKEN=$(cat PIA_TOKEN)
- PIA_SERVER_IP=$(cat PIA_SERVER_IP)
- PIA_WG_CN=$(cat PIA_WG_CN)
- PF_SIG="$(curl --interface oet1 --CAcert $PIA_CERT --get --silent --show-error --retry 5 --retry-delay 1 --max-time 2 --data-urlencode token=$PIA_TOKEN --resolve $PIA_WG_CN:19999:$PIA_SERVER_IP https://$PIA_WG_CN:19999/getSignature)"
- echo $PF_SIG
- #various files are generated which are needed to run portforwardbind.sh
- echo $PF_SIG>PF_SIG
- PF_PAYLOAD_RAW="$(echo $PF_SIG | jq -r '.payload')"
- echo $PF_PAYLOAD_RAW>PF_PAYLOAD_RAW
- PF_PAYLOAD="$(echo $PF_PAYLOAD_RAW | base64 -d )"
- echo $PF_PAYLOAD
- #unworking expiry function
- #PF_TOKEN_EXPIRY_RAW=$(echo $PF_PAYLOAD | jq -r .expires_at)
- #PF_TOKEN_EXPIRY=$(date --date="$PF_TOKEN_EXPIRY_RAW" +%s)
- PF_GETSIGNATURE=$(echo $PF_SIG | jq -r .signature)
- echo $PF_GETSIGNATURE>PF_GETSIGNATURE
- #pulls the assigned port
- PF_PORT=$(echo $PF_PAYLOAD | jq -r .port)
- echo $PF_PORT
- echo $PF_PORT>PF_PORT
- ./portforwardbind.sh
Add Comment
Please, Sign In to add comment