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 conf0wireguardConf() {
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 conf0sudo systemctl enable [email protected]
sudo systemctl daemon-reloadsudo systemctl start wg-quick@cloudflare0systemctl status wg-quick@cloudflare0sudo systemctl stop wg-quick@cloudflare0
sudo systemctl disable [email protected]
sudo rm -i /etc/systemd/system/wg-quick@cloudflare0*
sudo systemctl daemon-reload
sudo systemctl reset-failedThanks - https://www.ivpn.net/knowledgebase/linux/linux-autostart-wireguard-in-systemd/