browse_packages_ftp.sh revision 252810
1#!/bin/sh 2# $FreeBSD: head/usr.sbin/bsdconfig/examples/browse_packages.sh 252810 2013-07-05 17:54:08Z dteske $ 3# 4# This sample downloads the package INDEX file from FTP 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 12nonInteractive=1 13TMPDIR=/tmp 14if [ ! -e "$TMPDIR/packages/INDEX" ]; then 15 [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 16 _ftpPath=ftp://ftp-archive.freebsd.org 17 mediaSetFTP 18 mediaOpen 19 f_show_info "Downloading packages/INDEX from %s" "$_ftpPath" 20 f_device_get media packages/INDEX > $TMPDIR/packages/INDEX 21 mediaClose 22fi 23_directoryPath=$TMPDIR 24mediaSetDirectory 25configPackages 26