~cyphermox/ubuntu/vivid/ppp/merge-2.4.6

« back to all changes in this revision

Viewing changes to extra/0000usepeerdns-up

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2014-11-05 05:35:43 UTC
  • mfrom: (2.1.16 sid)
  • Revision ID: mathieu-tl@ubuntu.com-20141105053543-pwkdzpn4zae420uw
* Merge with Debian unstable; remaining changes:
  - debian/patches/load_ppp_generic_if_needed: load ppp_generic kernel
    module if needed.
  - add EAP-TLS/MPPE support patch from Jan Just Keijser.
  - debian/control: add libssl-dev to Build-Depends for the EAP-TLS patch.
* debian/patches/ppp-2.4.5-eaptls-mppe-0.994.patch,
  debian/patches/ppp-2.4.6-eaptls-mppe-0.997.patch: updated the EAP-TLS/MPPE
  support patch to the latest version from its upstream (also refreshed it).
* debian/ppp.preinst: deal with the change in LSB headers start runlevels
  of pppd-dns due to dropping our changes (which are no longer necessary
  since resolvconf is installed in most systems and has been for a while);
  this should probably be kept until the next LTS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
 
3
 
# this variable is only set if the usepeerdns pppd option is being used
4
 
[ "$USEPEERDNS" ] || exit 0
5
 
 
6
 
# exit if the resolvconf package is installed
7
 
[ -x /sbin/resolvconf ] && exit 0
8
 
 
9
 
# create the file if it does not exist
10
 
if [ ! -e /etc/resolv.conf ]; then
11
 
  : > /etc/resolv.conf
12
 
fi
13
 
 
14
 
# follow any symlink to find the real file
15
 
REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
16
 
 
17
 
# merge the new nameservers with the other options from the old configuration
18
 
{
19
 
  cat /etc/ppp/resolv.conf
20
 
  grep --invert-match '^nameserver[[:space:]]' "$REALRESOLVCONF" || true
21
 
} > "$REALRESOLVCONF.tmp"
22
 
 
23
 
# backup the old configuration and install the new one
24
 
cp -a "$REALRESOLVCONF" "$REALRESOLVCONF.pppd-backup.$PPP_IFACE"
25
 
mv -f "$REALRESOLVCONF.tmp" "$REALRESOLVCONF"
26
 
 
27
 
# restart nscd because resolv.conf has changed
28
 
if [ -e /var/run/nscd.pid ]; then
29
 
  /etc/init.d/nscd restart || true
30
 
fi
31
 
 
32
 
exit 0
33