1#!/bin/sh
2# -*- tcl -*- \
3exec tclsh "$0"  ${1+"$@"}
4
5# syntax: receive FILE
6# Run this before transmit, will wait for connection.
7
8set selfdir [file dirname [info script]]
9# Enable the commands below to run from a tcllib checkout
10#source $selfdir/../../modules/transfer/ddest.tcl
11#source $selfdir/../../modules/transfer/connect.tcl
12#source $selfdir/../../modules/transfer/receiver.tcl
13
14package require transfer::receiver
15package require tls
16
17set file [lindex $argv 0]
18
19proc OK {f args} {
20    puts "\nDone ($args) $f"
21    exit
22}
23
24proc PR {f args} {
25    puts "Progress ($args) $f"
26    return
27}
28
29set    type receiver
30source $selfdir/tlssetup.tcl
31
32transfer::receiver stream file $file {} 6789 \
33    -command  [list OK $file] \
34    -progress [list PR $file] \
35    -socketcmd tls::socket
36
37vwait forever
38exit
39