[Update] 添加脚本,将windows协议改为rdp

pull/1595/head
ibuler 2018-07-26 14:37:10 +08:00
parent ac238aa36e
commit 74c3f12275
2 changed files with 10 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class Gateway(AssetUser):
ip = models.GenericIPAddressField(max_length=32, verbose_name=_('IP'), db_index=True)
port = models.IntegerField(default=22, verbose_name=_('Port'))
protocol = models.CharField(choices=PROTOCOL_CHOICES, max_length=16, default=SSH_PROTOCOL, verbose_name=_("Protocol"))
domain = models.ForeignKey(Domain, verbose_name=_("Domain"))
domain = models.ForeignKey(Domain, verbose_name=_("Domain"), on_delete=models.CASCADE)
comment = models.CharField(max_length=128, blank=True, null=True, verbose_name=_("Comment"))
is_active = models.BooleanField(default=True, verbose_name=_("Is active"))

View File

@ -0,0 +1,9 @@
#!/bin/bash
#
python ../apps/manage.py shell << EOF
from assets.models import Asset
Asset.objects.filter(platform__startswith='Win').update(protocol='rdp')
EOF