home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Shareware / Comunicatii / nat32 / script / VNC < prev    next >
Text File  |  2004-06-05  |  767b  |  37 lines

  1. #!tcl 
  2.  
  3. # VNC mappings 
  4. #
  5.  
  6. if {$argc != 2 } { 
  7.     error {Usage: VNC IPaddress|off Port
  8.     Only the insecure port (5801-5899) need to be specified
  9.     to add or remove the VNC mappings}
  10. }
  11.  
  12. set addr [lindex $argv 0]
  13. set port [lindex $argv 1]
  14. set offset 100
  15. set portS [expr $port+$offset]
  16.  
  17. if {$port == 0} {
  18.     return
  19. }
  20.  
  21. if {$port < 5800} {
  22.     error {Port specification must be no lower than 5800 and no greater than 5899}
  23. }
  24.  
  25. if {$port > 5899} {
  26.     error {Port specification must be no greater than 5899 and no lower than 5800}
  27. }
  28.  
  29. if {$addr == "off"} { 
  30.     exec "ppmaps delete tcp $port"
  31.     exec "ppmaps delete tcp $portS"
  32. } else { 
  33.     exec "ppmap add tcp $port $addr $port"
  34.     exec "ppmap add tcp $portS $addr $portS"
  35.