mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-11-27 07:06:03 +01:00
Make the cluster's primary WireGuard option stop the primary server and its gateway in mirror mode
This commit is contained in:
@@ -16,13 +16,18 @@ python manage.py collectstatic --noinput
|
||||
# Export WireGuard, firewall and Caddy configs before bringing up interfaces
|
||||
python manage.py export_configs
|
||||
|
||||
# Starts each WireGuard configuration file found in /etc/wireguard
|
||||
# Starts each WireGuard configuration file found in /etc/wireguard, unless the cluster settings disable WireGuard
|
||||
# on the primary server
|
||||
shopt -s nullglob
|
||||
config_files=(/etc/wireguard/*.conf)
|
||||
if [ ${#config_files[@]} -gt 0 ]; then
|
||||
for f in "${config_files[@]}"; do
|
||||
wg-quick up "$(basename "${f}" .conf)"
|
||||
done
|
||||
if python manage.py primary_wireguard_enabled; then
|
||||
for f in "${config_files[@]}"; do
|
||||
wg-quick up "$(basename "${f}" .conf)"
|
||||
done
|
||||
else
|
||||
echo "WireGuard is disabled on the primary server, interfaces not started."
|
||||
fi
|
||||
fi
|
||||
if [[ "${DEV_MODE,,}" == "true" ]]; then
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user