summaryrefslogtreecommitdiffstats
path: root/remote/modules/dhcpc-busybox
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-20 12:37:19 +0200
committerSimon Rettberg2014-05-20 12:37:19 +0200
commit183031f091e56caa86fa48a89eee44a0819118eb (patch)
treea4625b1f5fac148bba7deccf754744b31b4bf8d4 /remote/modules/dhcpc-busybox
parent[pam-freiburg] dont exec the cifs part if no cifs volume is found (diff)
downloadtm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.tar.gz
tm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.tar.xz
tm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.zip
Make resolv.conf a symlink to /run/network/resolv.conf (where we generate ours from now on), in case someone wants to override the resolv.conf via config.tgz
Diffstat (limited to 'remote/modules/dhcpc-busybox')
-rwxr-xr-xremote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx18
1 files changed, 11 insertions, 7 deletions
diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index cf140246..482adedc 100755
--- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -19,20 +19,24 @@
. /opt/openslx/config
-RESOLV_CONF="/etc/resolv.conf"
+RESOLV_CONF="/run/network/resolv.conf"
THIS_RESOLV="/run/network/${interface}.resolv"
rebuild_resolv_conf () {
- # Maybe make this smarter some time, if anyone is using client's that are on multiple networks at once etc...
+ # Don't do anything if the active resolv.conf is not ours
+ # Also this will not run resolvconf update.d... No idea if we should still do so...
+ [ -L "/etc/resolv.conf" ] || return 0
+ [ "x$(readlink "/etc/resolv.conf")" == "x${RESOLV_CONF}" ] || return 0
+ # Maybe make this smarter some time, if anyone is using clients that are on multiple networks at once etc...
# This is a little braindead but should work most of the time
sort -u /run/network/*.resolv > "$RESOLV_CONF" 2> /dev/null
# add support for resolv.conf update scripts // see man(8) resolvconf
- if [ -d /etc/resolvconf/update.d ]; then
- for s in $(ls -1 /etc/resolvconf/update.d/*.sh); do
- $s
- done
- fi
+ if [ -d /etc/resolvconf/update.d ]; then
+ for s in $(ls -1 /etc/resolvconf/update.d/*.sh); do
+ $s
+ done
+ fi
}
escape_search() {