From ef395109e8a3a392cd1f74a552b30727e2fcdf19 Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 18 Mar 2022 10:29:21 -0400 Subject: [PATCH] Update wireguard-install.sh --- setup/wireguard-install.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/setup/wireguard-install.sh b/setup/wireguard-install.sh index d47b4a42..2309f036 100644 --- a/setup/wireguard-install.sh +++ b/setup/wireguard-install.sh @@ -73,6 +73,7 @@ echo -e "${CM}${CL} \r" echo -en "${GN} Installing Dependencies... " apt-get install -y curl &>/dev/null apt-get install -y sudo &>/dev/null +apt-get install -y gunicorn &>/dev/null echo -e "${CM}${CL} \r" echo -en "${GN} Installing WireGuard (using pivpn.io)... " @@ -80,7 +81,42 @@ curl -s -L https://install.pivpn.io > install.sh chmod +x install.sh ./install.sh --unattended options.conf &>/dev/null echo -e "${CM}${CL} \r" - + +echo -en "${GN} Installing pip3... " +apt-get install python3-pip -y &>/dev/null +pip install flask &>/dev/null +pip install ifcfg &>/dev/null +pip install flask_qrcode &>/dev/null +pip install icmplib &>/dev/null +echo -e "${CM}${CL} \r" + +echo -en "${GN} Installing WGDashboard... " +git clone -b v3.0.5 https://github.com/donaldzou/WGDashboard.git /ect/wgdashboard &>/dev/null +cd /ect/wgdashboard/src +sudo chmod u+x wgd.sh +sudo ./wgd.sh install &>/dev/null +sudo chmod -R 755 /etc/wireguard +echo -e "${CM}${CL} \r" + +echo -en "${GN} Creating wg-dashboard.service... " +service_path="/etc/systemd/system/wg-dashboard.service" +echo "[Unit] +After=netword.service + +[Service] +WorkingDirectory=/ect/wgdashboard/src +ExecStart=/usr/bin/python3 /ect/wgdashboard/src/dashboard.py +Restart=always + + +[Install] +WantedBy=default.target" > $service_path +sudo chmod 664 /etc/systemd/system/wg-dashboard.service +sudo systemctl daemon-reload +sudo systemctl enable wg-dashboard.service &>/dev/null +sudo systemctl start wg-dashboard.service +echo -e "${CM}${CL} \r" + PASS=$(grep -w "root" /etc/shadow | cut -b6); if [[ $PASS != $ ]]; then echo -en "${GN} Customizing Container... "