]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.sbin/bsdconfig/examples/browse_packages_http.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.sbin / bsdconfig / examples / browse_packages_http.sh
1 #!/bin/sh
2 # $FreeBSD$
3 #
4 # This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't
5 # already exist) and then displays the package configuration/management screen
6 # using the local INDEX file (results in faster browsing of packages from-start
7 # since the INDEX can be loaded from local media).
8 #
9 # NOTE: Packages cannot be installed unless staged to /tmp/packages/All
10 #
11 . /usr/share/bsdconfig/script.subr
12 nonInteractive=1
13 TMPDIR=/tmp
14 if [ ! -e "$TMPDIR/packages/INDEX" ]; then
15         [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1
16         _httpPath=http://ftp.freebsd.org
17         # For older releases, use http://ftp-archive.freebsd.org
18         mediaSetHTTP
19         mediaOpen
20         f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath"
21         f_device_get media packages/INDEX > $TMPDIR/packages/INDEX
22 fi
23 _directoryPath=$TMPDIR
24 mediaSetDirectory
25 configPackages