summaryrefslogtreecommitdiff
path: root/helpers/lh_confignetwork
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:40 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 10:04:40 +0200
commit6f5e2da03e5fd1af2200d2f55ca84647bc8d3626 (patch)
treee2a861c1995eea707b2ac1c72930351191714493 /helpers/lh_confignetwork
parent9a9491318d4a0469e4c97b28879ab34391c39095 (diff)
downloadvyos-live-build-6f5e2da03e5fd1af2200d2f55ca84647bc8d3626.tar.gz
vyos-live-build-6f5e2da03e5fd1af2200d2f55ca84647bc8d3626.zip
Adding live-package 0.99.22-1.
Diffstat (limited to 'helpers/lh_confignetwork')
-rwxr-xr-xhelpers/lh_confignetwork60
1 files changed, 60 insertions, 0 deletions
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 <action>
+
+# 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