Files
sysadmin/bin/wgX.sh

18 lines
335 B
Bash
Executable File

#!/bin/bash
verb=$1
iface=$(basename $0)
if [ -z "$verb" ]; then
verb=status;
fi
if [ "$verb" = "up" ] || [ "$verb" = "down" ]; then
sudo wg-quick $verb /etc/wireguard/${iface}.conf;
fi
if [ "$verb" = "status" ] || [ "$verb" = "start" ] || [ "$verb" = "stop" ]; then
sudo systemctl $verb wg-quick@${iface}.service;
fi