Plan 9 from Bell Labs’s /usr/web/sources/contrib/someone/root/rc/bin/service/tcp17015

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# ttftp service net netdir
#	(e.g., tcp17015 tcp /net/tcp/8)
rfork e
if (test -d /lib/tftpd)
	cd  /lib/tftpd		# for relative paths

args = `{read | tr -d '\015'}
f = $args(1)
mount -C /srv/main /n/main
if (test -r /n/main$f)
	f = /n/main$f

echo `{date} $sysname sending $f to `{cat $3/remote} >>/sys/log/ttftp
{ cp $f $3/data >>[2]/sys/log/ttftp; echo `{date} done >>/sys/log/ttftp } &

# paranoia: ttftp/tcp into vms is painfully slow, so force fall back to tftp/udp
sleep 16
echo hangup >$3/ctl

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.