Jump to content

Trying to create a script to make a PIA wiregaurd config for all the dockers that require it.


Recommended Posts

I'm trying to make a script that adds a wiregaurd file to my docker containers that need it, like my torrents.

This script is being made for PIA specifically and is based off their https://github.com/pia-foss/manual-connections repo.

 

My script downloads the repo that contains all the script files, then runs them using the command given in the repo above which creates a config at

 

/etc/wireguard/pia.conf

 

What I want to know is that since I am using the config for VPN purposes, should I also be adding the port of the docker container to the vpn config?

 

#!/bin/bash
# grab the current wiregaurd script from PIA
git clone https://github.com/pia-foss/manual-connections.git
cd manual-connections
find . -type f -exec chmod +x {} \;

# rFlood_VPN Config
sudo VPN_PROTOCOL=wireguard DISABLE_IPV6=yes DIP_TOKEN=no AUTOCONNECT=true PIA_PF=false PIA_DNS=true PIA_USER=p0000000 PIA_PASS=PIA_PASSWORD ./run_setup.sh

# Source file path
source_file="/etc/wireguard/pia.conf"

# rFlood_vpn Destination directory
destination_directory="/mnt/user/appdata/rflood-vpn/wireguard"

# Destination file name
destination_file="w0.config"

# Check if the source file exists
if [ -e "$source_file" ]; then
    # Create destination directory if it doesn't exist
    mkdir -p "$destination_directory"

    # Move and rename the file
    mv "$source_file" "$destination_directory/$destination_file"

    echo "File moved successfully to $destination_directory/$destination_file"
else
    echo "Source file $source_file not found."
fi

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...