summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/examples
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-09-23 16:47:52 +0000
committerdteske <dteske@FreeBSD.org>2013-09-23 16:47:52 +0000
commit64fbf758553e27367ea243f3b71bd0a09fc59001 (patch)
tree23751ed225bd593991bc9963b08e562085da94c9 /usr.sbin/bsdconfig/examples
parent23d9cd5eff5ee7d7588bd950e305cacab59ce40d (diff)
downloadFreeBSD-src-64fbf758553e27367ea243f3b71bd0a09fc59001.zip
FreeBSD-src-64fbf758553e27367ea243f3b71bd0a09fc59001.tar.gz
Fix a bug in HTTP checking/fetching.
Fix a bug in HTTP checking/fetching. Add Main Site to HTTP menu. Add new example script browse_packages_http.sh and move existing example script browse_packages.sh -> browse_packages_ftp.sh Reviewed by: gjb, brd Approved by: re (gjb), clusteradm (brd) MFC after: 3 days
Diffstat (limited to 'usr.sbin/bsdconfig/examples')
-rw-r--r--usr.sbin/bsdconfig/examples/Makefile2
-rwxr-xr-xusr.sbin/bsdconfig/examples/browse_packages_ftp.sh (renamed from usr.sbin/bsdconfig/examples/browse_packages.sh)0
-rwxr-xr-xusr.sbin/bsdconfig/examples/browse_packages_http.sh25
3 files changed, 26 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/examples/Makefile b/usr.sbin/bsdconfig/examples/Makefile
index 78711d2..d8813ce 100644
--- a/usr.sbin/bsdconfig/examples/Makefile
+++ b/usr.sbin/bsdconfig/examples/Makefile
@@ -3,7 +3,7 @@
NO_OBJ=
FILESDIR= ${SHAREDIR}/examples/bsdconfig
-FILES= browse_packages.sh bsdconfigrc
+FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc
beforeinstall:
mkdir -p ${DESTDIR}${FILESDIR}
diff --git a/usr.sbin/bsdconfig/examples/browse_packages.sh b/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh
index 1deb562..1deb562 100755
--- a/usr.sbin/bsdconfig/examples/browse_packages.sh
+++ b/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh
diff --git a/usr.sbin/bsdconfig/examples/browse_packages_http.sh b/usr.sbin/bsdconfig/examples/browse_packages_http.sh
new file mode 100755
index 0000000..e88a576
--- /dev/null
+++ b/usr.sbin/bsdconfig/examples/browse_packages_http.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# This sample downloads the package INDEX file from HTTP 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
+ _httpPath=http://ftp.freebsd.org
+ # For older releases, use http://ftp-archive.freebsd.org
+ mediaSetHTTP
+ mediaOpen
+ f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath"
+ f_device_get media packages/INDEX > $TMPDIR/packages/INDEX
+fi
+_directoryPath=$TMPDIR
+mediaSetDirectory
+configPackages
OpenPOWER on IntegriCloud