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:
@@ -0,0 +1,11 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from cluster.models import ClusterSettings
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Exit with status 1 when WireGuard is disabled on the primary server in the cluster settings'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if not ClusterSettings.primary_serves_clients():
|
||||
raise CommandError('WireGuard is disabled on the primary server in the cluster settings', returncode=1)
|
||||
Reference in New Issue
Block a user