mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-17 08:56:18 +00:00
Compare commits
2 Commits
DaanSelen-
...
docker-qui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5e9273889 | ||
|
|
c4d037047f |
@@ -32,10 +32,10 @@
|
||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">Monitoring WireGuard is not convenient, in most case, you'll need to login to your server and type <code>wg show</code>. That's why this project is being created, to view and manage all WireGuard configurations in an easy way.</p>
|
||||
<p align="center">Though all these awesome features are present, we are still striving to make it <b>easy to install and use</b></p>
|
||||
<p align="center">Monitoring WireGuard is not convenient, in most case, you'll need to login to your server and type <code>wg show</code>. That's why this project is being created, to view and manage all WireGuard configurations in a easy way.</p>
|
||||
<p align="center">With all these awesome features, while keeping it <b>easy to install and use</b></p>
|
||||
|
||||
<p align="center"><b><i>This project is not affiliated to the official WireGuard Project</i></b></p>
|
||||
<p align="center"><b><i>This project is not affiliate to the official WireGuard Project</i></b></p>
|
||||
|
||||
<h3 align="center">Looking for help or want to chat about this project?</h4>
|
||||
<p align="center">
|
||||
|
||||
@@ -53,10 +53,13 @@ set_ini() {
|
||||
|
||||
stop_service() {
|
||||
echo "[WGDashboard] Stopping WGDashboard..."
|
||||
kill $runtime_pid
|
||||
exit 0
|
||||
}
|
||||
|
||||
local max_rounds="10"
|
||||
local round="0"
|
||||
local runtime_pid=""
|
||||
grab_pid() {
|
||||
max_rounds="10"
|
||||
round="0"
|
||||
|
||||
while true; do
|
||||
round=$((round + 1))
|
||||
@@ -77,8 +80,6 @@ stop_service() {
|
||||
sleep 0.5s
|
||||
done
|
||||
|
||||
kill $runtime_pid
|
||||
exit 0
|
||||
}
|
||||
|
||||
echo "------------------------- START ----------------------------"
|
||||
@@ -217,7 +218,6 @@ start_and_monitor() {
|
||||
|
||||
[[ ! -d ${WGDASH}/src/log ]] && mkdir ${WGDASH}/src/log
|
||||
[[ ! -d ${WGDASH}/src/download ]] && mkdir ${WGDASH}/src/download
|
||||
|
||||
${WGDASH}/src/venv/bin/gunicorn --config ${WGDASH}/src/gunicorn.conf.py
|
||||
|
||||
/usr/sbin/resolvconf -u
|
||||
@@ -229,14 +229,13 @@ start_and_monitor() {
|
||||
# Wait a second before continuing, to give the python program some time to get ready.
|
||||
echo -e "\nEnsuring container continuation."
|
||||
|
||||
local max_rounds="10"
|
||||
local round="0"
|
||||
max_rounds="10"
|
||||
round="0"
|
||||
|
||||
# Hang in there for 10s for Gunicorn to get ready
|
||||
while true; do
|
||||
round=$((round + 1))
|
||||
|
||||
local latest_error=$(ls -t ${WGDASH}/src/log/error_*.log 2> /dev/null | head -n 1)
|
||||
latest_error=$(ls -t ${WGDASH}/src/log/error_*.log 2> /dev/null | head -n 1)
|
||||
|
||||
if [[ $round -eq $max_rounds ]]; then
|
||||
echo "Reached breaking point!"
|
||||
@@ -264,8 +263,15 @@ start_and_monitor() {
|
||||
tail -f "$latest_error" &
|
||||
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!"
|
||||
sleep 180s
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Main execution flow
|
||||
|
||||
Reference in New Issue
Block a user