jean-cloud-services/provisioning/roles/deploy_all/files/bin/startwg.sh

18 lines
224 B
Bash
Raw Normal View History

2023-06-08 07:34:51 +00:00
#!/bin/bash
set -euo pipefail
if [ "$#" -ne 1 ] ; then
echo "Usage: $0 <wgif>"
exit 1
fi
wgif="$1"
if [ -z "$(ip a | grep "$wgif")" ] ; then
wg-quick up "$wgif"
else
wg syncconf "$wgif" <(wg-quick strip "$wgif")
fi