libc.in (416ba5c74546f32a993436a99516d35008e9f384) libc.in (3f2a60a1371a69d7e9caac43bf457b6f89cdfd48)
1#!/bin/sh
1#!/bin/sh
2# Copyright (c) 2007-2014 Roy Marples
2# Copyright (c) 2007-2016 Roy Marples
3# All rights reserved
4
5# libc subscriber for resolvconf
6
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# * Redistributions of source code must retain the above copyright

--- 81 unchanged lines hidden (view full) ---

92 resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)"
93 fi
94 if [ -f "$SYSCONFDIR"/resolv.conf.d/tail ]; then
95 resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.d/tail)"
96 fi
97fi
98: ${resolv_conf:=/etc/resolv.conf}
99: ${libc_service:=nscd}
3# All rights reserved
4
5# libc subscriber for resolvconf
6
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# * Redistributions of source code must retain the above copyright

--- 81 unchanged lines hidden (view full) ---

92 resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)"
93 fi
94 if [ -f "$SYSCONFDIR"/resolv.conf.d/tail ]; then
95 resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.d/tail)"
96 fi
97fi
98: ${resolv_conf:=/etc/resolv.conf}
99: ${libc_service:=nscd}
100: ${libc_restart:=@RESTARTCMD ${libc_service}@}
101: ${list_resolv:=@SBINDIR@/resolvconf -l}
102if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then
103 resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)"
104fi
105if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then
106 resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)"
107fi
108

--- 115 unchanged lines hidden (view full) ---

224 if [ "$line" != "$signature" ]; then
225 cp "$resolv_conf" "$resolv_conf.bak"
226 fi
227 fi
228fi
229
230# Create our resolv.conf now
231(umask 022; echo "$newconf" >"$resolv_conf")
100: ${list_resolv:=@SBINDIR@/resolvconf -l}
101if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then
102 resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)"
103fi
104if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then
105 resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)"
106fi
107

--- 115 unchanged lines hidden (view full) ---

223 if [ "$line" != "$signature" ]; then
224 cp "$resolv_conf" "$resolv_conf.bak"
225 fi
226 fi
227fi
228
229# Create our resolv.conf now
230(umask 022; echo "$newconf" >"$resolv_conf")
232eval $libc_restart
231if [ -n "$libc_restart" ]; then
232 eval $libc_restart
233elif [ -n "$RESTARTCMD" ]; then
234 set -- ${libc_service}
235 eval $RESTARTCMD
236else
237 @SBINDIR@/resolvconf -r ${libc_service}
238fi
233
234retval=0
235# Notify users of the resolver
236for script in "$LIBEXECDIR"/libc.d/*; do
237 if [ -f "$script" ]; then
238 if [ -x "$script" ]; then
239 "$script" "$@"
240 else
241 (. "$script")
242 fi
243 retval=$(($retval + $?))
244 fi
245done
246exit $retval
239
240retval=0
241# Notify users of the resolver
242for script in "$LIBEXECDIR"/libc.d/*; do
243 if [ -f "$script" ]; then
244 if [ -x "$script" ]; then
245 "$script" "$@"
246 else
247 (. "$script")
248 fi
249 retval=$(($retval + $?))
250 fi
251done
252exit $retval