wireguardConf() {
conf=/etc/wireguard/${1}.conf
if test -f "$conf"; then
systemctl enable wg-quick@${1}.service
systemctl daemon-reload
systemctl start wg-quick@${1}
systemctl status wg-quick@${1}
fi
}
wireguardConf conf0
wireguardConf() {
conf=/etc/wireguard/${1}.conf
if test -f "$conf"; then
systemctl enable wg-quick@${1}.service
systemctl daemon-reload
systemctl start wg-quick@${1}
systemctl status wg-quick@${1}
fi
}
wireguardConf conf0
sudo systemctl enable wg-quick@cloudflare0.service
sudo systemctl daemon-reload
sudo systemctl start wg-quick@cloudflare0
systemctl status wg-quick@cloudflare0
sudo systemctl stop wg-quick@cloudflare0
sudo systemctl disable wg-quick@cloudflare0.service
sudo rm -i /etc/systemd/system/wg-quick@cloudflare0*
sudo systemctl daemon-reload
sudo systemctl reset-failed
Thanks - https://www.ivpn.net/knowledgebase/linux/linux-autostart-wireguard-in-systemd/