mirror of
https://github.com/pia-foss/manual-connections.git
synced 2025-02-05 14:08:29 +00:00
fix path to cert file, it must be dynamicly computed in absolute to be independent of the current running dir
This commit is contained in:
parent
2e29ad2d8d
commit
16c1e465d4
|
@ -19,6 +19,9 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# absolute path ot this file directory
|
||||
CURRENT_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# This function allows you to check if the required tools have been installed.
|
||||
function check_tool() {
|
||||
cmd=$1
|
||||
|
@ -94,7 +97,7 @@ export pubKey
|
|||
echo Trying to connect to the PIA WireGuard API on $WG_SERVER_IP...
|
||||
wireguard_json="$(curl -s -G \
|
||||
--connect-to "$WG_HOSTNAME::$WG_SERVER_IP:" \
|
||||
--cacert "ca.rsa.4096.crt" \
|
||||
--cacert "$CURRENT_FILE_DIR/ca.rsa.4096.crt" \
|
||||
--data-urlencode "pt=${PIA_TOKEN}" \
|
||||
--data-urlencode "pubkey=$pubKey" \
|
||||
"https://${WG_HOSTNAME}:1337/addKey" )"
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# absolute path ot this file directory
|
||||
CURRENT_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# This function allows you to check if the required tools have been installed.
|
||||
function check_tool() {
|
||||
cmd=$1
|
||||
|
@ -86,7 +89,7 @@ if [[ ! $PAYLOAD_AND_SIGNATURE ]]; then
|
|||
echo -n "Getting new signature... "
|
||||
payload_and_signature="$(curl -s -m 5 \
|
||||
--connect-to "$PF_HOSTNAME::$PF_GATEWAY:" \
|
||||
--cacert "ca.rsa.4096.crt" \
|
||||
--cacert "$CURRENT_FILE_DIR/ca.rsa.4096.crt" \
|
||||
-G --data-urlencode "token=${PIA_TOKEN}" \
|
||||
"https://${PF_HOSTNAME}:19999/getSignature")"
|
||||
else
|
||||
|
@ -133,7 +136,7 @@ Trying to bind the port... "
|
|||
while true; do
|
||||
bind_port_response="$(curl -Gs -m 5 \
|
||||
--connect-to "$PF_HOSTNAME::$PF_GATEWAY:" \
|
||||
--cacert "ca.rsa.4096.crt" \
|
||||
--cacert "$CURRENT_FILE_DIR/ca.rsa.4096.crt" \
|
||||
--data-urlencode "payload=${payload}" \
|
||||
--data-urlencode "signature=${signature}" \
|
||||
"https://${PF_HOSTNAME}:19999/bindPort")"
|
||||
|
|
Loading…
Reference in New Issue
Block a user