diff options
author | dteske <dteske@FreeBSD.org> | 2013-07-05 17:54:08 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-07-05 17:54:08 +0000 |
commit | 96610810d3906c18e719e6a14e55b435f99cda57 (patch) | |
tree | 374de52667d3ffa5c8404c08c6f89420da454624 | |
parent | 75276888a51f99d0f502f09dfbc38904cc734361 (diff) | |
download | FreeBSD-src-96610810d3906c18e719e6a14e55b435f99cda57.zip FreeBSD-src-96610810d3906c18e719e6a14e55b435f99cda57.tar.gz |
Add example shell script for creating a local INDEX file that can be
accessed quickly for browsing a list of available packages.
-rwxr-xr-x | usr.sbin/bsdconfig/examples/browse_packages.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/usr.sbin/bsdconfig/examples/browse_packages.sh b/usr.sbin/bsdconfig/examples/browse_packages.sh new file mode 100755 index 0000000..4e947b9 --- /dev/null +++ b/usr.sbin/bsdconfig/examples/browse_packages.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from FTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _ftpPath=ftp://ftp-archive.freebsd.org + mediaSetFTP + mediaOpen + f_show_info "Downloading packages/INDEX from %s" "$_ftpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + mediaClose +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages |