-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.gorc
47 lines (46 loc) · 1.2 KB
/
example.gorc
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
[
("Group 1", "Group of actions 1", "menu", [
("action 1", "This is the action 1", "execute", "ssh server1"),
("action 2", "This is the action 2", "execute", "echo 'Hello world!'"),
("action 3", "This is the action 3", "execute", "ps -ef |grep root"),
('action-submenu', "This is the submenu", "menu", [
('a1', "Action a1", "execute", "echo a1"),
('a2', "Action a2", "execute", "echo a2"),
('a3', "Action a3", "execute", "echo a3"),
]),
("action 5", "This is the action 3", "expect", """
send_user "Connecting to server...\n"
set timeout 60
spawn ssh server
expect {
"Are you sure you want to continue connecting (yes/no)?" {
send "yes\n"
exp_continue
}
-regexp "user.+server.+~.+$" {
# Logged in!
}
timeout {
send_user "Timed out during waiting for connection to host!\n"
exit
}
}
interact
"""
),
]
),
("Group 2", "Group of actions 2", 'menu', [
("Group-2a", "g1", "menu", [
("Group 2aa", "", 'execute', "")
]
),
("Action-2b", "g2", "execute", "echo 42"),
("Group-2c", "g3", "menu", [
("Group 2ca", "", 'execute', "echo 84")
]
),
]
),
("Action a", 'This is some action', 'execute', 'echo Voila')
]