-
Notifications
You must be signed in to change notification settings - Fork 5
/
remote.py
65 lines (57 loc) · 4.66 KB
/
remote.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from core import plugin, model
class _remote(plugin._plugin):
version = 1.48
def install(self):
# Register models
model.registerModel("remoteConnectLinux","_remoteConnectLinux","_action","plugins.remote.models.action")
model.registerModel("remoteCommand","_remoteCommand","_action","plugins.remote.models.action")
model.registerModel("remoteConnectWindows","_remoteConnectWindows","_action","plugins.remote.models.action")
model.registerModel("remoteDownload","_remoteDownload","_action","plugins.remote.models.action")
model.registerModel("remoteUpload","_remoteUpload","_action","plugins.remote.models.action")
model.registerModel("remoteDisconnect","_remoteDisconnect","_action","plugins.remote.models.action")
model.registerModel("remoteReboot","_remoteReboot","_action","plugins.remote.models.action")
model.registerModel("remotePullWinEvents","_remotePullWinEvents","_trigger","plugins.remote.models.trigger")
model.registerModel("remoteConnectFortigate","_remoteConnectFortigate","_action","plugins.remote.models.action")
model.registerModel("remoteMultiCommand","_remoteMultiCommand","_action","plugins.remote.models.action")
model.registerModel("remoteConnectCisco","_remoteConnectCisco","_action","plugins.remote.models.action")
model.registerModel("remoteConnectWindowsPSExec","_remoteConnectWindowsPSExec","_action","plugins.remote.models.action")
return True
def uninstall(self):
# deregister models
model.deregisterModel("remoteConnectLinux","_remoteConnectLinux","_action","plugins.remote.models.action")
model.deregisterModel("remoteCommand","_remoteCommand","_action","plugins.remote.models.action")
model.deregisterModel("remoteConnectWindows","_remoteConnectWindows","_action","plugins.remote.models.action")
model.deregisterModel("remoteDownload","_remoteDownload","_action","plugins.remote.models.action")
model.deregisterModel("remoteUpload","_remoteUpload","_action","plugins.remote.models.action")
model.deregisterModel("remoteDisconnect","_remoteDisconnect","_action","plugins.remote.models.action")
model.deregisterModel("remoteReboot","_remoteReboot","_action","plugins.remote.models.action")
model.deregisterModel("remotePullWinEvents","_remotePullWinEvents","_trigger","plugins.remote.models.trigger")
model.deregisterModel("remoteConnectFortigate","_remoteConnectFortigate","_action","plugins.remote.models.action")
model.deregisterModel("remoteMultiCommand","_remoteMultiCommand","_action","plugins.remote.models.action")
model.deregisterModel("remoteConnectCisco","_remoteConnectCisco","_action","plugins.remote.models.action")
model.deregisterModel("remoteConnectWindowsPSExec","_remoteConnectWindowsPSExec","_action","plugins.remote.models.action")
return True
def upgrade(self,LatestPluginVersion):
if self.version < 1.1:
model.registerModel("remotePullWinEvents","_remotePullWinEvents","_trigger","plugins.remote.models.trigger")
if self.version < 0.7:
model.registerModel("remoteReboot","_remoteReboot","_action","plugins.remote.models.action")
if self.version < 0.5:
model.registerModel("remoteDisconnect","_remoteDisconnect","_action","plugins.remote.models.action")
if self.version < 0.4:
model.registerModel("remoteUpload","_remoteUpload","_action","plugins.remote.models.action")
if self.version < 0.3:
model.registerModel("remoteDownload","_remoteDownload","_action","plugins.remote.models.action")
if self.version < 0.2:
model.registerModel("remoteConnectWindows","_remoteConnectWindows","_action","plugins.remote.models.action")
if self.version < 1.2:
model.registerModel("remoteConnectFortigate","_remoteConnectFortigate","_action","plugins.remote.models.action")
if self.version < 1.3:
model.registerModel("remoteMultiCommand","_remoteMultiCommand","_action","plugins.remote.models.action")
if self.version < 1.42:
model.registerModel("remoteConnectCisco","_remoteConnectCisco","_action","plugins.remote.models.action")
if self.version < 1.43:
model.registerModel("remoteConnectWindowsPSExec","_remoteConnectWindowsPSExec","_action","plugins.remote.models.action")
model.deregisterModel("linuxStartPortForward","_remoteLinuxStartPortForward","_action","plugins.remote.models.action")
model.deregisterModel("linuxStopPortForward","_remoteLinuxStopPortForward","_action","plugins.remote.models.action")
return True