You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
362 B
18 lines
362 B
#!/bin/sh |
|
|
|
if test $(id -u) -ne 0; then |
|
echo "must run as root" |
|
exit |
|
fi |
|
|
|
|
|
PROFILE_DIR="wg_profiles" |
|
CONN='' |
|
|
|
for f in $(ls "$PROFILE_DIR"); do |
|
CONN=$(echo $f | cut -d . -f 1) |
|
echo "importing $CONN" |
|
nmcli connection import type wireguard file $PROFILE_DIR/$CONN.conf |
|
nmcli connection down $CONN |
|
nmcli connection modify $CONN connection.autoconnect no |
|
done
|
|
|