From 6f5e2da03e5fd1af2200d2f55ca84647bc8d3626 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 10:04:40 +0200 Subject: Adding live-package 0.99.22-1. --- helpers/lh_confignetwork | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 helpers/lh_confignetwork (limited to 'helpers/lh_confignetwork') diff --git a/helpers/lh_confignetwork b/helpers/lh_confignetwork new file mode 100755 index 000000000..892020df2 --- /dev/null +++ b/helpers/lh_confignetwork @@ -0,0 +1,60 @@ +#!/bin/sh + +# lh_patchnetwork.sh + +# Packages which are manually installed inside the chroot are installed +# from the network. Therefore, we need to be able to resolv hosts. + +case "${1}" in + apply-hosts) + # Save host lookup table + if [ -f "${LIVE_CHROOT}"/etc/hosts ] + then + cp "${LIVE_CHROOT}"/etc/hosts \ + "${LIVE_CHROOT}"/etc/hosts.orig + fi + + # Copy host lookup table + if [ -f /etc/hosts ] + then + cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts + fi + ;; + + apply-resolv) + # Save resolver configuration + if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ] + then + cp "${LIVE_CHROOT}"/etc/resolv.conf \ + "${LIVE_CHROOT}"/etc/resolv.conf.orig + fi + + # Copy resolver configuration + if [ -f /etc/resolv.conf ] + then + cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf + fi + ;; + + deapply-hosts) + # Restore host lookup table + if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ] + then + mv "${LIVE_CHROOT}"/etc/hosts.orig \ + "${LIVE_CHROOT}"/etc/hosts + else + rm -f "${LIVE_CHROOT}"/etc/hosts + fi + ;; + + deapply-resolv) + # Restore resolver configuration + if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ] + then + mv "${LIVE_CHROOT}"/etc/resolv.conf.orig \ + "${LIVE_CHROOT}"/etc/resolv.conf + else + rm -f "${LIVE_CHROOT}"/etc/resolv.conf + fi + ;; +esac -- cgit v1.2.3