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