mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-11-27 15:16:03 +01:00
12 lines
459 B
Python
12 lines
459 B
Python
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)
|