2011-03-30 13:53:33 +00:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
# prereq: mountfs
|
|
|
|
# desc: download or continue to download the distribution archives
|
|
|
|
|
|
|
|
switch($1) {
|
|
|
|
case checkready
|
|
|
|
devs=(`{cat /net/ipifc/*/status >[2]/dev/null |
|
|
|
|
grep -v '127\.0\.0\.1' |
|
|
|
|
sed 's/ .*//'})
|
|
|
|
if(~ $#devs 0) {
|
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
if(~ $mountdist done){
|
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
|
|
|
|
case go
|
2015-07-13 04:28:46 +00:00
|
|
|
default=()
|
|
|
|
if(~ $#installurl 1)
|
|
|
|
default=(-d $installurl)
|
|
|
|
prompt $default 'Installation url'
|
|
|
|
installurl=$rd
|
2011-03-30 13:53:33 +00:00
|
|
|
|
2015-07-13 04:28:46 +00:00
|
|
|
if(! test -e /mnt/web/ctl)
|
|
|
|
webfs
|
2011-03-30 13:53:33 +00:00
|
|
|
|
2015-07-13 04:28:46 +00:00
|
|
|
srvmedia=(ip/httpfile -s httpdist $installurl/9front.iso)
|
|
|
|
mountmedia=(mount /srv/httpdist /n/distmedia)
|
|
|
|
distmediadir=/
|
|
|
|
export srvmedia mountmedia distmediadir
|
2011-03-30 13:53:33 +00:00
|
|
|
|
|
|
|
case checkdone
|
2015-07-13 04:28:46 +00:00
|
|
|
if(! test -f /n/distmedia/9front.iso) {
|
2011-03-30 13:53:33 +00:00
|
|
|
download=notdone
|
|
|
|
export download
|
|
|
|
}
|
|
|
|
}
|