Created
March 1, 2023 03:02
-
-
Save notpike/01762cb5782c0757080106be8a1cb392 to your computer and use it in GitHub Desktop.
Import .ovpn files to Network Manager
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
#!/bin/bash | |
UNAME="" | |
PASS='' | |
echo "== START ==" | |
for file in *; do | |
if [ -f "$file" ]; then | |
if [ ${file: -5} == ".ovpn" ]; then | |
echo "Importing" ${file::-5} | |
nmcli connection import type openvpn file "$file" | |
nmcli con modify "${file::-5}" vpn.user-name $UNAME | |
nmcli con modify "${file::-5}" vpn.secrets password=$PASS | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment