Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- . /usr/share/bsdconfig/script.subr
- nonInteractive=1
- #debug=1
- if [ "$1" = "/tmp" ]; then
- shift 1 # /tmp
- _directoryPath=/tmp
- mediaSetDirectory
- mediaOpen
- else
- _ftpPath=ftp://ftp-archive.freebsd.org
- mediaSetFTP
- mediaOpen
- echo "ftpHost=[$ftpHost] ftpPort=[$ftpPort]"
- echo "ftpDirectory=[$ftpDirectory]"
- echo "=="
- fi
- FILE=packages/INDEX
- size=$( f_device_get media "$FILE" $PROBE_SIZE ) ||
- f_die 1 "$FILE: No such file or directory"
- echo "Downloading $FILE ($size bytes) to /dev/null"
- if [ "$1" = "fail" ]; then # pv seems to have a bug
- exec 7<<-EOF
- $( f_device_get media $FILE )
- EOF
- pv -s $size <&7 > /dev/null
- else
- f_device_get media "$FILE" | pv -s $size > /dev/null
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement