Update alpine-wireguard-install.sh
This commit is contained in:
parent
66a4e8250f
commit
630521e846
@ -69,33 +69,31 @@ ListenPort = 51820
|
|||||||
EOF
|
EOF
|
||||||
msg_ok "Created Example Config for WGDashboard"
|
msg_ok "Created Example Config for WGDashboard"
|
||||||
|
|
||||||
msg_info "Creating Supervisor Service for WGDashboard"
|
msg_info "Creating Service for WGDashboard"
|
||||||
mkdir -p /etc/supervisord.d/
|
cat <<EOF > /etc/init.d/wg-dashboard
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
cat <<EOF > /etc/supervisord.d/wg-dashboard.ini
|
description="WireGuard Dashboard Service"
|
||||||
[program:wg-dashboard]
|
|
||||||
command=/etc/wgdashboard/src/wgd.sh start
|
depend() {
|
||||||
autostart=true
|
need net
|
||||||
autorestart=true
|
after firewall
|
||||||
stderr_logfile=/var/log/wg-dashboard.err.log
|
}
|
||||||
stdout_logfile=/var/log/wg-dashboard.out.log
|
|
||||||
|
start() {
|
||||||
|
ebegin "Starting WGDashboard"
|
||||||
|
cd /etc/wgdashboard/src/ || exit 1
|
||||||
|
./wgd.sh start &
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
ebegin "Stopping WGDashboard"
|
||||||
|
pkill -f "wgd.sh"
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
|
msg_ok "Created Service for WGDashboard"
|
||||||
if [[ ! -f /etc/supervisord.conf ]]; then
|
|
||||||
cat <<EOF > /etc/supervisord.conf
|
|
||||||
[supervisord]
|
|
||||||
nodaemon=true
|
|
||||||
|
|
||||||
[include]
|
|
||||||
files = /etc/supervisord.d/*.ini
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Starting Supervisor Daemon"
|
|
||||||
nohup supervisord -c /etc/supervisord.conf &>/dev/null &
|
|
||||||
msg_ok "Started Supervisor Daemon"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user