rwddemo 0.91 → 0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme.txt +32 -305
- data/code/01rwdcore/01rwdcore.rb +15 -13
- data/code/01rwdcore/jumplinkcommand.rb +30 -0
- data/code/01rwdcore/openhelpwindow.rb +26 -26
- data/code/01rwdcore/returntomain.rb +8 -8
- data/code/01rwdcore/rwdtinkerversion.rb +12 -13
- data/code/01rwdcore/rwdwindowreturn.rb +3 -5
- data/code/01rwdcore/test_cases.rb +115 -0
- data/code/01rwdcore/test_harness.rb +12 -0
- data/code/01rwdcore/uploadreturns.rb +62 -0
- data/code/dd0viewphoto/dd0viewphoto.rb +3 -4
- data/code/superant.com.rwdcalc/jumplinkupdate.rb +11 -0
- data/code/superant.com.rwdcalendar/helptexthashrwdschedule.rb +14 -0
- data/code/superant.com.rwdcalendar/openhelpwindowrwdschedule.rb +17 -0
- data/code/superant.com.rwdshell/helptexthashshell.rb +8 -1
- data/code/superant.com.rwdshell/openhelpwindowshell.rb +6 -0
- data/code/superant.com.rwdshell/runrwdshellwindow.rb +4 -1
- data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +89 -92
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +16 -18
- data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -19
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +7 -7
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +48 -49
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +8 -7
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +22 -26
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -31
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -13
- data/code/superant.com.rwdtinkerbackwindow/network.rb +82 -82
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -17
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +37 -37
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +20 -20
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +33 -32
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +8 -9
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +10 -11
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -18
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -20
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +23 -20
- data/configuration/language.dist +1 -1
- data/configuration/rwddemo.dist +3 -0
- data/configuration/rwdtinker.dist +3 -3
- data/configuration/tinkerwin2variables.dist +1 -1
- data/gui/frontwindow0/superant.com.rwdcalendar/hl9calendar.rwd +1 -1
- data/gui/frontwindow0/superant.com.shellscripts/3editscripts.rwd +1 -0
- data/gui/frontwindow0/viewlogo/cc0openphoto.rwd +22 -0
- data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +2 -7
- data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd +15 -0
- data/gui/frontwindowselections/viewselectionzend/viewselectionend.rwd +3 -0
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.rwdcalc/81jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/46editscriptrecord.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/94rwddiagnostics.rwd +0 -17
- data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/98jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +12 -16
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
- data/init.rb +231 -228
- data/rwd_files/HowTo_Tinker.txt +20 -0
- data/rwdconfig.dist +6 -2
- data/tests/makedist.rb +36 -7
- metadata +54 -69
- data/code/superant.com.rwdshell/runrwdshellmenu1.rb +0 -57
- data/configuration/language.cnf +0 -7
- data/configuration/rwdapplicationidentity.cnf +0 -3
- data/configuration/rwdcalc.cnf +0 -7
- data/configuration/rwdcalendar.cnf +0 -10
- data/configuration/rwdshell.cnf +0 -3
- data/configuration/rwdtinker.cnf +0 -15
- data/configuration/tinkerwin2variables.cnf +0 -17
- data/extras/cmdline_parse +0 -47
- data/extras/config_file +0 -69
- data/extras/errorMsg +0 -19
- data/extras/makePlaylist +0 -34
- data/extras/mp3controld +0 -289
- data/extras/playlist +0 -186
- data/extras/showHelp +0 -18
- data/gui/frontwindowselections/superant.com.rwdcalcselectiontab/rwdcalc.rwd +0 -12
- data/gui/frontwindowselections/superant.com.rwdshellselectiontab/rwdshellbackwindowselectiontab.rwd +0 -12
- data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +0 -12
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +0 -4
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +0 -3
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +0 -10
- data/gui/tinkerbackwindows/superant.com.rwdcalc/98returntab.rwd +0 -11
- data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/v9returntab.rwd +0 -11
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +0 -11
- data/rwdconfig.cnf +0 -6
@@ -1,31 +1,31 @@
|
|
1
1
|
# this code is to call the help window
|
2
2
|
def runhelpwindow
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
3
|
+
$helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
|
4
|
+
|
5
|
+
if @rwd_window == "main"
|
6
|
+
if @rwd_tab == "documentsrwdtinkerone"
|
7
|
+
$help_topic = "documents_rwdtinker"
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
if @rwd_window == "rwdtinkerhelpwindow"
|
13
|
+
puts "in help window processing"
|
14
|
+
else
|
15
|
+
$previouswindow = @rwd_window
|
16
|
+
$previoustab = @rwd_tab
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
@rwdhelptopic = $help_topic
|
21
|
+
@rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
|
22
|
+
@rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
|
23
|
+
@rwd_window = "rwdtinkerhelpwindow"
|
24
24
|
end
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
|
26
|
+
def choosenewhelptopic(inffile)
|
27
|
+
$help_topic = inffile
|
28
|
+
runhelpwindow
|
29
|
+
end
|
30
30
|
|
31
31
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
|
2
2
|
#
|
3
|
-
# For
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# call the window
|
6
|
+
def returntomain
|
7
|
+
@rwd_window = "main"
|
8
|
+
@rwd_tab = "selectiontab"
|
9
|
+
end
|
10
|
+
|
@@ -1,15 +1,14 @@
|
|
1
1
|
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
2
|
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
-
# http://www.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# return the version constant defined in the config file
|
6
|
+
def runrwdtinkerversion
|
7
|
+
@rwd_window = "applicationversion"
|
8
|
+
@versionappnamedisplay = "RwdTinker"
|
9
|
+
@versioncopyrightdisplay = "(c) 2004 Steven Gibson "
|
10
|
+
@versionnumberdisplay = "Version " + RwdTinkerVersion
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# test harness
|
2
|
+
def rwdtinker_all_tests
|
3
|
+
print "in rwdtinker all tests\n"
|
4
|
+
test_runrwdtinkerbackwindow
|
5
|
+
end
|
6
|
+
|
7
|
+
def test_runrwdtinkerbackwindow
|
8
|
+
|
9
|
+
require 'test/unit'
|
10
|
+
begin
|
11
|
+
|
12
|
+
runrwdtinkerbackwindow
|
13
|
+
|
14
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerbackwindow'
|
15
|
+
|
16
|
+
rescue NotImplementedError
|
17
|
+
$stderr.print $!
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
def test_choosenewhelptopic
|
25
|
+
raise NotImplementedError, 'Need to write test_choosenewhelptopic'
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def test_listinstalledfiles
|
30
|
+
raise NotImplementedError, 'Need to write test_listinstalledfiles'
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def test_listzipfilestoinstall
|
35
|
+
raise NotImplementedError, 'Need to write test_listzipfilestoinstall'
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_loadconfigurationrecord
|
39
|
+
raise NotImplementedError, 'Need to write test_loadconfigurationrecord'
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_loadconfigurationvariables
|
43
|
+
raise NotImplementedError, 'Need to write test_loadconfigurationvariables'
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
def test_main
|
49
|
+
raise NotImplementedError, 'Need to write test_main'
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_network_demon
|
53
|
+
raise NotImplementedError, 'Need to write test_network_demon'
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_network_start
|
57
|
+
raise NotImplementedError, 'Need to write test_network_start'
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_openappletname
|
61
|
+
raise NotImplementedError, 'Need to write test_openappletname'
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_removeapplet
|
65
|
+
raise NotImplementedError, 'Need to write test_removeapplet'
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_returntomain
|
69
|
+
raise NotImplementedError, 'Need to write test_returntomain'
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_runcontrolcommand
|
73
|
+
raise NotImplementedError, 'Need to write test_runcontrolcommand'
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
def test_runhelpwindow
|
78
|
+
raise NotImplementedError, 'Need to write test_runhelpwindow'
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
def test_runrwdtinkerversion
|
85
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerversion'
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_runrwdtinkerwin2version
|
89
|
+
raise NotImplementedError, 'Need to write test_runrwdtinkerwin2version'
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_runviewplatform
|
93
|
+
raise NotImplementedError, 'Need to write test_runviewplatform'
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_rwdtinkerversiondiagnostic
|
97
|
+
raise NotImplementedError, 'Need to write test_rwdtinkerversiondiagnostic'
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_rwdwindowreturn
|
101
|
+
raise NotImplementedError, 'Need to write test_rwdwindowreturn'
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_saveconfigurationrecord
|
105
|
+
raise NotImplementedError, 'Need to write test_saveconfigurationrecord'
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
def test_viewappletcontents
|
110
|
+
raise NotImplementedError, 'Need to write test_viewappletcontents'
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
def uploadreturnsfile
|
2
|
+
require 'net/ftp'
|
3
|
+
BasicSocket.do_not_reverse_lookup = true
|
4
|
+
@returnsftpdisplays = ""
|
5
|
+
randomnumber = rand(9999) + 1000
|
6
|
+
puts randomnumber.to_i
|
7
|
+
|
8
|
+
|
9
|
+
returns_ftpsite = "ftp.superant.com"
|
10
|
+
returns_ftplogin = "anonymous@superant.com"
|
11
|
+
returns_ftppassword = "anonymous@superant.com"
|
12
|
+
returns_ftpdirectory = "/incoming/returns/"
|
13
|
+
|
14
|
+
begin
|
15
|
+
platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
|
16
|
+
platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
|
17
|
+
platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
|
18
|
+
platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
|
19
|
+
platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
|
20
|
+
platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
|
21
|
+
platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
|
22
|
+
if ! @a_emailupload.empty?
|
23
|
+
platformdisplay = platformdisplay + @a_emailupload + "\n"
|
24
|
+
end
|
25
|
+
if ! @a_emailupload.empty?
|
26
|
+
platformdisplay = platformdisplay + @a_commentupload + "\n"
|
27
|
+
end
|
28
|
+
updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
|
29
|
+
|
30
|
+
tmpdir = ENV['TMP']
|
31
|
+
if tmpdir.to_s.empty?
|
32
|
+
tmpdir = "/tmp"
|
33
|
+
end
|
34
|
+
fileName = File.join( tmpdir, updatefile)
|
35
|
+
fd = File.open(fileName,"w")
|
36
|
+
fd.print(platformdisplay) # save the record info to the file
|
37
|
+
fd.close
|
38
|
+
ftp = Net::FTP::new(returns_ftpsite)
|
39
|
+
@returnsftpdisplay = "data uploaded" + "\n"
|
40
|
+
|
41
|
+
filedirname = File.join(tmpdir,updatefile)
|
42
|
+
|
43
|
+
ftp.debug_mode = false
|
44
|
+
ftp.login(returns_ftplogin, returns_ftppassword)
|
45
|
+
ftp.chdir(returns_ftpdirectory)
|
46
|
+
print "I'm in the directory ", ftp.pwd(), "\n"
|
47
|
+
|
48
|
+
puts filedirname
|
49
|
+
ftp.puttextfile(filedirname , updatefile)
|
50
|
+
@returnsftpdisplay = @returnsftpdisplay + platformdisplay
|
51
|
+
|
52
|
+
|
53
|
+
ftp.close
|
54
|
+
|
55
|
+
rescue
|
56
|
+
@returnsftpdisplay = "upload error"
|
57
|
+
if ftp
|
58
|
+
ftp.close
|
59
|
+
end
|
60
|
+
print "ftp error"
|
61
|
+
end
|
62
|
+
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
end
|
1
|
+
def viewphoto
|
2
|
+
@rwd_window = "photo"
|
3
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#jumplinkupdate
|
2
|
+
|
3
|
+
JumpLink.update(:RwdCalc=>"runrwdcalcwindow",
|
4
|
+
:DocumentScreen=>"runtinkerdocuments",
|
5
|
+
:RwdShellBackWindow=>"runrwdshellbackwindow",
|
6
|
+
:RunShell=>"runrwdshellwindow"
|
7
|
+
)
|
8
|
+
$rwdjumplink +=["RwdCalc",
|
9
|
+
"DocumentScreen",
|
10
|
+
"RwdShellBackWindow",
|
11
|
+
"RunShell"]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# this code is to call the help window
|
2
|
+
def runhelpwindowrwdcalendar
|
3
|
+
|
4
|
+
$help_topic = "calendar_help"
|
5
|
+
if @rwd_tab == "calendar"
|
6
|
+
$help_topic = "calendar_help"
|
7
|
+
end
|
8
|
+
$helptopicsarray = $helptopicsarray | ["calendar_help"]
|
9
|
+
|
10
|
+
if @rwd_window != "rwdtinkerhelpwindow"
|
11
|
+
$previouswindow = @rwd_window
|
12
|
+
$previoustab = @rwd_tab
|
13
|
+
end
|
14
|
+
runhelpwindow
|
15
|
+
end
|
16
|
+
|
17
|
+
|
@@ -20,5 +20,12 @@
|
|
20
20
|
|
21
21
|
You can edit the commands or comment
|
22
22
|
|
23
|
-
|
23
|
+
|
24
|
+
'Save Changes' will save the changes you have made - BE CERTAIN YOUR CHANGES ARE CORRECT
|
25
|
+
'Reload Variables' will load the changes you have made - otherwise your changes will be lost next reboot",
|
26
|
+
|
27
|
+
:shelledit_help => "You can edit scripts here
|
28
|
+
'Fill Record' will load the file selected on the script run tab
|
29
|
+
'Save Changes' will save the changes you have made -
|
30
|
+
'Clear' will clear the screen "
|
24
31
|
)
|
@@ -9,6 +9,12 @@ def runhelpwindowrwdshell
|
|
9
9
|
if @rwd_tab == "viewrwdshellconfiguration"
|
10
10
|
$help_topic = "ShellEnvironment_help"
|
11
11
|
end
|
12
|
+
if @rwd_tab == "EditScriptsrwdshell"
|
13
|
+
$help_topic = "shelledit_help"
|
14
|
+
end
|
15
|
+
if @rwd_tab == "editrubyrecordfile"
|
16
|
+
$help_topic = "shelledit_help"
|
17
|
+
end
|
12
18
|
|
13
19
|
|
14
20
|
|
@@ -1,99 +1,96 @@
|
|
1
1
|
# Bind message passing socket to rwdtinker application
|
2
|
-
|
3
2
|
def runcontrolcommand
|
4
|
-
require 'socket'
|
5
|
-
|
6
|
-
# Change this line...
|
7
|
-
|
8
|
-
# And this one...
|
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
|
-
# Rescue all other errors
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
remotehostnotfound = true
|
53
|
-
if (commandtext == "query")
|
54
|
-
begin
|
55
|
-
client = UDPSocket::new()
|
56
|
-
client.send(commandtext, 0, ip, port)
|
57
|
-
@socket = UDPSocket::new()
|
58
|
-
@socket.bind(ip, port)
|
59
|
-
# Rescue the "Address in use" error
|
60
|
-
rescue Errno::EADDRINUSE
|
61
|
-
|
62
|
-
databack, info = client.recv(128)
|
63
|
-
@remotecommandresult = databack
|
64
|
-
@lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
|
65
|
-
remotehostnotfound = false
|
66
|
-
|
67
|
-
# Rescue the "Address not available' error
|
68
|
-
rescue Errno::EADDRNOTAVAIL
|
69
|
-
puts "Network plugin: Address #{host} is not available to bind."
|
70
|
-
|
71
|
-
# Rescue "permission denied errors
|
72
|
-
rescue Errno::EACCES
|
73
|
-
puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
|
74
|
-
|
75
|
-
# Rescue all other errors
|
76
|
-
rescue
|
77
|
-
puts "Network plugin: An error occured."
|
78
|
-
|
79
|
-
# Rescue all other errors
|
80
|
-
end
|
81
|
-
@socket.close
|
82
|
-
|
83
|
-
# Close the socket after use
|
84
|
-
client.close()
|
85
|
-
end
|
3
|
+
require 'socket'
|
4
|
+
|
5
|
+
# Change this line...
|
6
|
+
ip = '127.0.0.1'
|
7
|
+
# And this one...
|
8
|
+
port = $rwdcontrolport1
|
9
|
+
if @a_remoteportinput
|
10
|
+
port = @a_remoteportinput.to_i
|
11
|
+
end
|
12
|
+
|
13
|
+
commandtext = @a_remotecommandinput.to_s
|
14
|
+
remotehostnotfound = true
|
15
|
+
if (commandtext == "stop")
|
16
|
+
begin
|
17
|
+
client = UDPSocket::new()
|
18
|
+
client.send(commandtext, 0, ip, port)
|
19
|
+
@socket = UDPSocket::new()
|
20
|
+
@socket.bind(ip, port)
|
21
|
+
# Rescue the "Address in use" error
|
22
|
+
rescue Errno::EADDRINUSE
|
23
|
+
|
24
|
+
databack, info = client.recv(128)
|
25
|
+
@remotecommandresult = databack
|
26
|
+
@lastremotecommand = "rwdtinker remote:: Port #{port} on host #{ip} ."
|
27
|
+
remotehostnotfound = false
|
28
|
+
|
29
|
+
# Rescue the "Address not available" error
|
30
|
+
rescue Errno::EADDRNOTAVAIL
|
31
|
+
puts "Network plugin: Address #{host} is not available to bind."
|
32
|
+
|
33
|
+
# Rescue "permission denied errors
|
34
|
+
rescue Errno::EACCES
|
35
|
+
puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
|
36
|
+
|
37
|
+
# Rescue all other errors
|
38
|
+
rescue
|
39
|
+
puts "Network plugin: An error occured."
|
40
|
+
|
41
|
+
# Rescue all other errors
|
42
|
+
end
|
43
|
+
if remotehostnotfound
|
44
|
+
@remotecommandresult = "Remote Host not running"
|
45
|
+
end
|
46
|
+
@socket.close
|
47
|
+
# Close the socket after use
|
48
|
+
client.close()
|
49
|
+
end
|
86
50
|
|
87
|
-
|
88
|
-
|
89
|
-
|
51
|
+
remotehostnotfound = true
|
52
|
+
if (commandtext == "query")
|
53
|
+
begin
|
54
|
+
client = UDPSocket::new()
|
55
|
+
client.send(commandtext, 0, ip, port)
|
56
|
+
@socket = UDPSocket::new()
|
57
|
+
@socket.bind(ip, port)
|
58
|
+
# Rescue the "Address in use" error
|
59
|
+
rescue Errno::EADDRINUSE
|
60
|
+
|
61
|
+
databack, info = client.recv(128)
|
62
|
+
@remotecommandresult = databack
|
63
|
+
@lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
|
64
|
+
remotehostnotfound = false
|
65
|
+
|
66
|
+
# Rescue the "Address not available' error
|
67
|
+
rescue Errno::EADDRNOTAVAIL
|
68
|
+
puts "Network plugin: Address #{host} is not available to bind."
|
69
|
+
|
70
|
+
# Rescue "permission denied errors
|
71
|
+
rescue Errno::EACCES
|
72
|
+
puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
|
73
|
+
|
74
|
+
# Rescue all other errors
|
75
|
+
rescue
|
76
|
+
puts "Network plugin: An error occured."
|
77
|
+
|
78
|
+
# Rescue all other errors
|
79
|
+
end
|
80
|
+
@socket.close
|
81
|
+
|
82
|
+
# Close the socket after use
|
83
|
+
client.close()
|
84
|
+
end
|
85
|
+
|
86
|
+
if remotehostnotfound
|
87
|
+
@remotecommandresult = "Remote Host not running"
|
88
|
+
end
|
90
89
|
end
|
91
90
|
|
92
91
|
# list the remote control options on the screen
|
93
92
|
def showremoteportoptions
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
93
|
+
|
94
|
+
@remoteportoptions = $rwdcontrolports.rwd_options
|
95
|
+
@remotecommandoptions = ["query","stop"].rwd_options
|
96
|
+
end
|