forked from z1pti3/jimiPlugin-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote.py
54 lines (45 loc) · 3.5 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
from core import plugin, model
class _remote(plugin._plugin):
version = 1.2
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("linuxStartPortForward","_remoteLinuxStartPortForward","_action","plugins.remote.models.action")
model.registerModel("linuxStopPortForward","_remoteLinuxStopPortForward","_action","plugins.remote.models.action")
model.registerModel("remotePullWinEvents","_remotePullWinEvents","_trigger","plugins.remote.models.trigger")
model.registerModel("remoteConnectFortigate","_remoteConnectFortigate","_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")
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")
return True