A flexible VPN manager script that supports multiple VPN providers through OpenVPN configuration files. Features an interactive rofi menu system for easy provider, country, city, and server selection.
- ๐ Multi-Provider Support - Manage multiple VPN providers from one interface
- ๐ Hierarchical Selection - Choose provider โ country โ city โ server
- ๐ฒ Random Selection - Randomly select provider, country, city, or server
- ๐ Scrambled Connection Support - Automatically detects and offers scrambled servers when available
- ๐ Per-Provider Authentication - Each provider has its own credentials file
- ๐ Connection Feedback - Desktop notifications with connection status and public IP
- โก Smart Server Detection - Automatically parses OpenVPN files and builds dynamic menus
- ๐บ๏ธ Global Coverage - Supports 70+ country codes across all continents
bashopenvpnrofinotify-send(libnotify)curlsudoprivileges
-
Clone the repository:
git clone https://github.com/digitalcanine/multivpn cd multivpn -
Create the providers directory structure:
mkdir -p providers
-
Make the script executable:
chmod +x dc-multivpn.sh
multivpn/
โโโ dc-multivpn.sh # Main script
โโโ providers/ # Providers directory
โโโ provider1/ # Provider name (e.g., nordvpn, mullvad, pia)
โ โโโ auth # Authentication file
โ โโโ servers/ # OpenVPN config files
โ โโโ city1-us-001.ovpn
โ โโโ city1-us-002.ovpn
โ โโโ city2-uk-001-scramble.ovpn
โ โโโ ...
โโโ provider2/
โโโ auth
โโโ servers/
โโโ ...
For each VPN provider you want to use:
cd providers
mkdir your-provider-name
cd your-provider-nameCreate an auth file with your credentials:
cat > auth << EOF
your_username
your_password
EOFSecurity note: Keep your auth file secure:
chmod 600 authCreate a servers directory and add your .ovpn files:
mkdir servers
# Copy your .ovpn files here
cp /path/to/configs/*.ovpn servers/The script expects OpenVPN files to follow this naming format:
city-countrycode-###.ovpn
city-countrycode-###-scramble.ovpn
Examples:
new-york-us-001.ovpnlondon-uk-042.ovpntokyo-jp-015-scramble.ovpnlos-angeles-us-100.ovpn
Format breakdown:
city: City name (lowercase, hyphens for spaces)countrycode: Two-letter country code (lowercase)###: Three-digit server number-scramble(optional): Indicates obfuscated/scrambled server
The script recognizes 70+ country codes including:
North America: us, ca, mx
Europe: uk/gb, de, fr, nl, ch, es, it, se, no, dk, fi, pl, cz, and more
Asia: jp, kr, sg, hk, tw, in, th, my, id, ph, vn
Oceania: au, nz
South America: br, ar, cl, co, pe
Middle East: ae, sa, il, qa
Africa: za, eg, ng, ke, ma
./dc-multivpn.shOr bind it to a keyboard shortcut (example for sxhkd):
alt + shift + v
/path/to/multivpn/dc-multivpn.sh- Select Provider - Choose from your configured providers or select random
- Select Country - Choose a country or random
- Select City - Choose a city or random
- Select Connection Type - Regular or Scrambled (if both available)
- Select Server - Choose specific server or random
- Enter Password - Provide sudo password for OpenVPN
- Connection Status - Notification shows connection details and public IP
- [Random Provider] - Selects a random provider
- [Random Country] - Selects a random country from the provider
- [Random City] - Selects a random city
- [Random Server] - Selects a random server
- [Disconnect] - Kills any active OpenVPN connection
Edit the ROFI variable in the script:
ROFI="rofi -dmenu -i -theme your-theme"Modify the NOTIFY variable:
NOTIFY="notify-send -t 5000" # Show notifications for 5 secondsEdit the sleep duration after OpenVPN launch (line ~390):
sleep 8 # Wait 8 seconds for connection to establish- Auth Files: Keep authentication files secure with
chmod 600 auth - Sudo Access: The script requires sudo privileges to run OpenVPN
- Password Storage: Consider using
sudowith NOPASSWD for OpenVPN in/etc/sudoersto avoid entering password each time:your_username ALL=(ALL) NOPASSWD: /usr/bin/openvpn, /usr/bin/pkill openvpn
- Ensure you have created provider directories in the
providers/folder - Check that each provider has an
authfile andservers/directory
- Verify your
.ovpnfiles follow the naming convention:city-cc-###.ovpn - Ensure files are in the
providers/PROVIDER_NAME/servers/directory
- Check that your
authfile contains correct credentials - Verify OpenVPN configs are valid
- Check system logs:
journalctl -u openvpn --since "5 minutes ago"
- The script waits 8 seconds and retries 3 times
- Check your internet connection
- Verify
curlis installed
Complete example for NordVPN:
cd multivpn/providers
mkdir nordvpn
cd nordvpn
# Create auth file
cat > auth << EOF
[email protected]
mypassword123
EOF
chmod 600 auth
# Create servers directory
mkdir servers
# Download OpenVPN configs from NordVPN and rename them
# e.g., us9999.nordvpn.com.tcp.ovpn โ new-york-us-001.ovpn
cp ~/Downloads/us9999.nordvpn.com.tcp.ovpn servers/new-york-us-001.ovpn
cp ~/Downloads/uk2345.nordvpn.com.tcp.ovpn servers/london-uk-001.ovpnContributions are welcome! Feel free to submit issues or pull requests for:
- Additional country code support
- Bug fixes
- Feature enhancements
- Documentation improvements
This project is open source and available under the MIT License.
- bspwm-rice - My complete bspwm desktop configuration that includes MultiVPN integration