From 723365a79df7cc0fd29b1af8f7ef200a7e0921b1 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 21 Aug 2024 16:12:01 -0400 Subject: [PATCH] Update wireguard-install.sh - refactor code - breaking change --- install/wireguard-install.sh | 55 +++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/install/wireguard-install.sh b/install/wireguard-install.sh index 7cd00403..e1b470fc 100644 --- a/install/wireguard-install.sh +++ b/install/wireguard-install.sh @@ -17,29 +17,46 @@ msg_info "Installing Dependencies" $STD apt-get install -y curl $STD apt-get install -y sudo $STD apt-get install -y mc -$STD apt-get install -y gunicorn +$STD apt-get install -y git msg_ok "Installed Dependencies" -msg_info "Installing WireGuard (using pivpn.io)" -OPTIONS_PATH='/options.conf' -cat >$OPTIONS_PATH <>/etc/sysctl.conf +$STD sysctl -p /etc/sysctl.conf +msg_ok "Installed WGDashboard" + +msg_info "Creating Service" +cat </etc/systemd/system/wg-dashboard.service +[Unit] +After=syslog.target network-online.target +Wants=wg-quick.target +ConditionPathIsDirectory=/etc/wireguard + +[Service] +Type=forking +PIDFile=/etc/wgdashboard/src/gunicorn.pid +WorkingDirectory=/etc/wgdashboard/src +ExecStart=/etc/wgdashboard/src/wgd.sh start +ExecStop=/etc/wgdashboard/src/wgd.sh stop +ExecReload=/etc/wgdashboard/src/wgd.sh restart +TimeoutSec=120 +PrivateTmp=yes +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now wg-dashboard.service +msg_ok "Created Service" + motd_ssh customize