mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-15 16:06:17 +00:00
Compare commits
5 Commits
v4.3.1
...
docker-qui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5e9273889 | ||
|
|
82e10659b6 | ||
|
|
b6f25ac817 | ||
|
|
48481ab992 | ||
|
|
c4d037047f |
3
.github/workflows/docker.yml
vendored
3
.github/workflows/docker.yml
vendored
@@ -7,6 +7,9 @@ on:
|
||||
- 'main'
|
||||
tags:
|
||||
- '*'
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'docker/**'
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/WGDashboard/WGDashboard/releases/latest"><img src="https://img.shields.io/github/v/release/donaldzou/wireguard-dashboard?style=for-the-badge"></a>
|
||||
<a href="https://wakatime.com/badge/github/donaldzou/WGDashboard"><img src="https://wakatime.com/badge/github/donaldzou/WGDashboard.svg?style=for-the-badge" alt="wakatime"></a>
|
||||
<a href="https://wakatime.com/badge/github/donaldzou/WGDashboard"><img src="https://wakatime.com/badge/user/45f53c7c-9da9-4cb0-85d6-17bd38cc748b/project/5334ae20-e9a6-4c55-9fea-52d4eb9dfba6.svg?style=for-the-badge" alt="wakatime"></a>
|
||||
<a href="https://hitscounter.dev"><img src="https://hitscounter.dev/api/hit?url=https%3A%2F%2Fgithub.com%2Fdonaldzou%2FWGDashboard&label=Visitor&icon=github&color=%230a58ca&style=for-the-badge"></a>
|
||||
<img src="https://img.shields.io/docker/pulls/donaldzou/wgdashboard?logo=docker&label=Docker%20Image%20Pulls&labelColor=ffffff&style=for-the-badge">
|
||||
<img src="https://github.com/WGDashboard/WGDashboard/actions/workflows/docker.yml/badge.svg?style=for-the-badge">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
config_file="/data/wg-dashboard.ini"
|
||||
runtime_pid=""
|
||||
|
||||
trap 'stop_service' SIGTERM
|
||||
|
||||
@@ -52,10 +53,35 @@ set_ini() {
|
||||
|
||||
stop_service() {
|
||||
echo "[WGDashboard] Stopping WGDashboard..."
|
||||
/bin/bash ./wgd.sh stop
|
||||
kill $runtime_pid
|
||||
exit 0
|
||||
}
|
||||
|
||||
grab_pid() {
|
||||
max_rounds="10"
|
||||
round="0"
|
||||
|
||||
while true; do
|
||||
round=$((round + 1))
|
||||
|
||||
if [[ -f ${WGDASH}/src/gunicorn.pid ]]; then
|
||||
runtime_pid=$(cat ${WGDASH}/src/gunicorn.pid)
|
||||
|
||||
echo "Running as PID: ${runtime_pid}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $round -eq $max_rounds ]]; then
|
||||
echo "Reached breaking point!"
|
||||
return 1
|
||||
|
||||
fi
|
||||
|
||||
sleep 0.5s
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
echo "------------------------- START ----------------------------"
|
||||
echo "Starting the WGDashboard Docker container."
|
||||
|
||||
@@ -194,7 +220,7 @@ start_and_monitor() {
|
||||
[[ ! -d ${WGDASH}/src/download ]] && mkdir ${WGDASH}/src/download
|
||||
${WGDASH}/src/venv/bin/gunicorn --config ${WGDASH}/src/gunicorn.conf.py
|
||||
|
||||
resolvconf -u
|
||||
/usr/sbin/resolvconf -u
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Loading WGDashboard failed... Look above for details."
|
||||
@@ -235,8 +261,12 @@ start_and_monitor() {
|
||||
|
||||
else
|
||||
tail -f "$latest_error" &
|
||||
wait $!
|
||||
tail_pid=$!
|
||||
|
||||
echo "Grabbing PID..."
|
||||
grab_pid &
|
||||
|
||||
wait $tail_pid
|
||||
fi
|
||||
|
||||
echo "The blocking command has been broken! Script will exit in 3 minutes... Investigate!"
|
||||
|
||||
Reference in New Issue
Block a user