jean-cloud-services/provisioning/roles/deploy_all/files/bin/startwg.sh
Adrian Amaglio 48a27ddf71 update
2023-06-08 09:34:51 +02:00

18 lines
224 B
Bash
Executable File

#!/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