Plan 9 from Bell Labs’s /usr/web/sources/contrib/zwansch/rc/cdpull

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


#!/bin/rc

fn getmtime {
	ls -l $1 | awk '{print $7 $8 $9}'
}

url='http://plan9.bell-labs.com/plan9/download/plan9.iso.bz2'
echo -n 'Downloading current plan9.iso.bz2 ... '
cd $home/tmp
omtime=`{getmtime plan9.iso.bz2}
hget -o plan9.iso.bz2 $url
echo 'done'
nmtime=`{getmtime plan9.iso.bz2}

if (~ $nmtime $omtime) {
	echo 'plan9.iso.bz2 is current.'
}
if not {
	echo -n 'Extracting plan9.iso.bz2 ... '
	cat plan9.iso.bz2 | bunzip2 > plan9.iso
	echo 'done'
}

echo -n 'Mounting plan.iso ... '
test -e /srv/9660 || 9660srv
mount /srv/9660 /n/dist $home/tmp/plan9.iso;
echo 'done'

echo 'Starting replica.'
rfork e
flags=()
while(! ~ $#* 0 && ~ $1 -*){
	if(~ $1 -c -s){
		flags=($flags $1)
		shift
	}
	flags=($flags $1)
	shift
}
if(test -f /srv/kfs.cmd)
	disk/kfscmd allow
replica/pull $flags /dist/replica/cd $*
if(test -f /srv/kfs.cmd)
	disk/kfscmd disallow

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].