File: adminExample.cfg

package info (click to toggle)
anyremote 4.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,236 kB
  • ctags: 819
  • sloc: ansic: 5,234; sh: 985; python: 86; makefile: 77
file content (92 lines) | stat: -rw-r--r-- 3,319 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
%
% anyremote configuration file for  customization of GUI of Java client. (Server-mode)
%

% STATUS stable
% XTEST no
% SOUND no
% ENV no

% Uncomment if needed
%AutoRepeat=false
%Baudrate=19200
%Device=bluetooth:19
%Log=true
Screen=true

GuiAppName=Admin
GuiAppType=Example
GuiAppBinary=true

[Aliases]
% Cancel buttons on different phones
-11=Cancel
-8=Cancel
69=Cancel

% Aliases for AverMedia IR remote
TEXT=*
POWER=#
[End]

[Keys]

Cancel=Exit

(Connect)=ExecAndSet(status,uname -n);\
	ExecAndSet(title,whoami);\
	Set(icons,ADMIN,1,plus,2,default,3,default,4,default,5,default,6,default,7,default,8,default,9,default,*,default,0,exit,#,default);

* *=Set(text,replace,Help,1 - Show list of features\n0 - Exit)
Back=Set(text,close);

1=SetMode(LIST);
0=Exit;

[Mode]=LIST
(EnterMode)=Set(list,replace,Available commands,Disk free space,Uptime, User Processes,File List,Dmesg output,Reboot,Shutdown);Set(menu,replace,Choose);
Back($$)=Set(list,close);SetMode(default);

TOP_TIMER=ExecAndSet(text,replace,top,top -bn 1|head -10|tr -s ' '|cut -f 2,3,10,13 -d ' '|tail -5);

Choose(Disk free space)=ExecAndSet(text,replace,Free Space,df -kl|tr -s ' '|cut -f 1,4 -d ' ');SetMode(TXT);
%Choose(Run Top)        =SetMode(TXT);Timer(TOP_TIMER,5,0);
%Choose(Stop Top)       =Timer(TOP_TIMER,cancel);
Choose(Uptime)         =Set(list,close);ExecAndSet(title,uptime|tr -s ' '|cut -d ' ' -f 3,4,5);SetMode(default);
Choose(File List)      =SetMode(FILES);
Choose(User Processes) =SetMode(PROCS);
Choose(Dmesg output)   =ExecAndSet(text,replace,Dmesg output, dmesg|tail -50);SetMode(TXT);
Choose(Reboot)	       =Exec(reboot)
Choose(Shutdown)       =Exec(poweroff)
[ModeEnd]

[Mode]=TXT
Back=Set(text,close);Timer(TOP_TIMER,cancel);SetMode(LIST);
[ModeEnd]

[Mode]=FILES

(EnterMode)=ExecAndSet(list,replace,Files,cd `cat $HOME/.anyRemote/ar_storedir.tmp`;echo `pwd`>$HOME/.anyRemote/ar_storedir.tmp;ls -F| sed 's/$/,/'|sed 's/(/openbrace/g'|sed 's/)/closebrace/g');Set(list,add,SAME,..);Set(menu,replace,Choose,File info);

File info($$)=ExecAndSet(text,replace,File info,cd `cat $HOME/.anyRemote/ar_storedir.tmp`;file $(Param));Set(text,add,SAME,\n);ExecAndSet(text,add,File info,cd `cat $HOME/.anyRemote/ar_storedir.tmp`;ls -l $(Param));SetMode(TXT2);
Choose($$)=ExecAndSet(list,replace,SAME,echo 'cd `cat $HOME/.anyRemote/ar_storedir.tmp`;if [ -d $(Param) ]; then cd $(Param);fi;pwd>$HOME/.anyRemote/ar_storedir.tmp;ls -F| sed "s/$/,/"|sed "s/(/openbrace/g"|sed "s/)/closebrace/g";'|bash -f -s);Set(list,add,SAME,..)

%Back($$)=SetMode(LIST);Set(list,replace,Available commands,Disk free space,Run Top, Stop Top, Uptime, User Processes, File List,Dmesg output);Set(menu,replace,Choose);
Back($$)=SetMode(LIST);Set(list,replace,Available commands,Disk free space,Uptime, User Processes, File List,Dmesg output);Set(menu,replace,Choose);

[ModeEnd]

[Mode]=TXT2
Back=Set(text,close);SetMode(FILES);
[ModeEnd]

[Mode]=PROCS

(EnterMode)=ExecAndSet(list,replace,User Processes, ps -o pid -o command -u `whoami`|tr -s ' '|cut -d ' ' -f 1,2,3|sed 's/$/,/'|grep -v sed|grep -v cut);Set(menu,replace,Kill);

Kill($$)=Exec(kill `echo $(Param)|cut -d ' ' -f 1`);ExecAndSet(list,replace,SAME,ps -o pid -o command -u `whoami`|tr -s ' '|cut -d ' ' -f 1,2,3|sed 's/$/,/'|grep -v sed|grep -v cut);
Back($$)=SetMode(LIST);

[ModeEnd]

[End]