-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example for proton vpn port forwarding setup
- Loading branch information
1 parent
ee041f3
commit 3da4f5e
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
LISTEN_PORT="$1" | ||
QBIT_PROTOCOL="${QBIT_PROTOCOL:-http}" | ||
QBIT_HOST="${QBIT_HOST:-127.0.0.1}" | ||
QBIT_PORT="${QBIT_PORT:-8080}" | ||
|
||
# add curl if not already installed | ||
apk info | grep -q ^curl || apk add curl | ||
|
||
# syntax specific to sh | ||
for run in $(seq 1 10) | ||
do | ||
echo "Try $run/10 to set port to $LISTEN_PORT" | ||
curl -ks --data 'json={"listen_port": "'"$LISTEN_PORT"'"}' ${QBIT_PROTOCOL}://${QBIT_HOST}:${QBIT_PORT}/api/v2/app/setPreferences | ||
if [ $? -eq 0 ]; then | ||
echo "Port $LISTEN_PORT set successfully" | ||
break | ||
fi | ||
echo "Failed to set port, retrying in 5 seconds" | ||
sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters