#!/usr/bin/tclsh # svsendconf by Paolo Subiaco iw3grx@ir3ip.net http://www.ir3ip.net/iw3grx # # How to install: edit file tnt.ini (probably in /usr/local/share/tnt/conf ?) # and set the variable pty_timeout to 1 second: This way the script should wait # for at least 1 second before sending the next line, to get 1 line per frame. # # pty_timeout 1 # # Read the tnt_bin_dir variable: i suppose it should be set to /usr/local/libexec/tnt # so you must put this script into that directory, # mv svsendconf /usr/local/libexec/tnt/svsendconf # # then set X permission with # chmod 755 /usr/local/libexec/tnt/svsendconf # # You may edit the line set filepath "path_to_your_config_files" to make # the job easier... # Finally, run tnt, connect the SuperVozelj node, type K and send password, and # type # # :run svsendconf filename [delay_in_ms] # # where filename is the config file, with entire path if it is not located into # filepath dir, and delay is an option parameter >=1200 that you may specify # to use different delay between sending lines. # Note: you must NOT use delay < than 1000 ms !! # # # For any requests, post a message in the SuperVozelj forum at # http://www.ir3ip.net/forum/ # set filepath "/mnt/fat/bbs/sv" ;# define dir where configuration files are kept #puts stderr "SvSendConf by Paolo Subiaco http://www.ir3ip.net/iw3grx\n" fconfigure stdin -blocking 0 set inputfile [lindex $argv 0] if {[llength $argv] >= 2} { set delay [lindex $argv 1] } else { set delay 1200 } if {[catch {open $inputfile} fd]} { if {[catch {open $filepath/$inputfile} fd]} { puts stderr "*** Error opening file $inputfile or $filepath/$inputfile" puts stderr "*** Edit $argv0 script to change path where input file are located!" return } } #puts stderr "Sending configuration file..." while {[gets $fd line]>0} { puts $line flush stdout after $delay while {[gets stdin linein] >0} {} ;# Read stdin (TNT stdout) } close $fd