home *** CD-ROM | disk | FTP | other *** search
- #!tcl
-
- #
- # VNC mappings
- #
-
- if {$argc != 2 } {
- error {Usage: VNC IPaddress|off Port
- Only the insecure port (5801-5899) need to be specified
- to add or remove the VNC mappings}
- }
-
- set addr [lindex $argv 0]
- set port [lindex $argv 1]
- set offset 100
- set portS [expr $port+$offset]
-
- if {$port == 0} {
- return
- }
-
- if {$port < 5800} {
- error {Port specification must be no lower than 5800 and no greater than 5899}
- }
-
- if {$port > 5899} {
- error {Port specification must be no greater than 5899 and no lower than 5800}
- }
-
- if {$addr == "off"} {
- exec "ppmaps delete tcp $port"
- exec "ppmaps delete tcp $portS"
- } else {
- exec "ppmap add tcp $port $addr $port"
- exec "ppmap add tcp $portS $addr $portS"
- }
-