summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2006-10-24 09:12:14 +0000
committerAlin Năstac <mrness@gentoo.org>2006-10-24 09:12:14 +0000
commitd59a0a41ada4906642fe8ca125fdb327cb343462 (patch)
tree5fafc0df003e8b2b593ed1a8b340ed5f47a871fa /net-dialup/ppp/files
parentChanged jms and javamail dependencies to sun-jms and sun-javamail instead of ... (diff)
downloadgentoo-2-d59a0a41ada4906642fe8ca125fdb327cb343462.tar.gz
gentoo-2-d59a0a41ada4906642fe8ca125fdb327cb343462.tar.bz2
gentoo-2-d59a0a41ada4906642fe8ca125fdb327cb343462.zip
Remove obsolete versions
(Portage version: 2.1.1)
Diffstat (limited to 'net-dialup/ppp/files')
-rw-r--r--net-dialup/ppp/files/ip-down31
-rw-r--r--net-dialup/ppp/files/ip-up53
2 files changed, 50 insertions, 34 deletions
diff --git a/net-dialup/ppp/files/ip-down b/net-dialup/ppp/files/ip-down
index 77e05655a585..f1422e53d620 100644
--- a/net-dialup/ppp/files/ip-down
+++ b/net-dialup/ppp/files/ip-down
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# this is a script which is executed after disconnecting the ppp interface.
# look at man pppd for details
@@ -12,26 +12,29 @@
# $6 = ipparam
if [ "$USEPEERDNS" ]; then
+ if [ -x /sbin/resolvconf ]; then
+ resolvconf -d "$1"
+ else
+ # taken from debian's 0000usepeerdns
+ # follow any symlink to find the real file
+ REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
- # taken from debian's 0000usepeerdns
- # follow any symlink to find the real file
- REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
+ if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
- if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
+ # if an old resolv.conf file exists, restore it
+ if [ -e $REALRESOLVCONF.pppd-backup ]; then
+ mv $REALRESOLVCONF.pppd-backup $REALRESOLVCONF
+ fi
- # if an old resolv.conf file exists, restore it
- if [ -e $REALRESOLVCONF.pppd-backup ]; then
- mv $REALRESOLVCONF.pppd-backup $REALRESOLVCONF
fi
-
fi
-
fi
-# Recreate the default route so autodial works
-[ -s /etc/conf.d/net ] && . /etc/conf.d/net
-if [ -n "${gateway}" ] && [ "${gateway%/*}" = "$1" ]; then
- /sbin/route add default dev ${gateway%/*}
+if [ -x /etc/init.d/net.$1 ]; then
+ if /etc/init.d/net.$1 --quiet status ; then
+ export IN_BACKGROUND="true"
+ /etc/init.d/net.$1 --quiet stop
+ fi
fi
[ -f /etc/ppp/ip-down.local ] && . /etc/ppp/ip-down.local "$@"
diff --git a/net-dialup/ppp/files/ip-up b/net-dialup/ppp/files/ip-up
index 5dee00ad32d4..786ace1e3785 100644
--- a/net-dialup/ppp/files/ip-up
+++ b/net-dialup/ppp/files/ip-up
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# this is a script which is executed after connecting the ppp interface.
# look at man pppd for details
@@ -13,30 +13,43 @@
if [ "$USEPEERDNS" ]; then
- # add the server supplied DNS entries to /etc/resolv.conf
- # (taken from debian's 0000usepeerdns)
-
- # follow any symlink to find the real file
- REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
-
- if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
-
- # merge the new nameservers with the other options from the old configuration
- {
+ if [ -x /sbin/resolvconf ]; then
+ conf="# Generated by ppp for $1\n"
+ [ -n "$DNS1" ] && conf="${conf}nameserver $DNS1\n"
+ [ -n "$DNS2" ] && conf="${conf}nameserver $DNS2\n"
+ echo -e "$conf" | resolvconf -a "$1"
+ else
+ # add the server supplied DNS entries to /etc/resolv.conf
+ # (taken from debian's 0000usepeerdns)
+
+ # follow any symlink to find the real file
+ REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
+
+ if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
+
+ # merge the new nameservers with the other options from the old configuration
+ {
grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF
cat /etc/ppp/resolv.conf
- } > $REALRESOLVCONF.tmp
-
- # backup the old configuration and install the new one
- cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
- mv $REALRESOLVCONF.tmp $REALRESOLVCONF
+ } > $REALRESOLVCONF.tmp
+
+ # backup the old configuration and install the new one
+ cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
+ mv $REALRESOLVCONF.tmp $REALRESOLVCONF
+
+ # correct permissions
+ chmod 0644 /etc/resolv.conf
+ chown root:root /etc/resolv.conf
+ fi
+ fi
- # correct permissions
- chmod 0644 /etc/resolv.conf
- chown root:root /etc/resolv.conf
+fi
+if [ -x /etc/init.d/net.$1 ]; then
+ if ! /etc/init.d/net.$1 --quiet status ; then
+ export IN_BACKGROUND="true"
+ /etc/init.d/net.$1 --quiet start
fi
-
fi
[ -f /etc/ppp/ip-up.local ] && . /etc/ppp/ip-up.local "$@"