/[gentoo-x86]/net-misc/openvpn/files/down.sh
Gentoo

Contents of /net-misc/openvpn/files/down.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download) (as text)
Tue Sep 25 12:47:01 2007 UTC (7 years ago) by uberlord
Branch: MAIN
Changes since 1.5: +10 -8 lines
File MIME type: text/x-sh
PEER_DNS now allows OpenVPN to create /etc/resolv.conf or not, #193668
(Portage version: 2.1.3.9)

1 uberlord 1.4 #!/bin/sh
2 uberlord 1.5 # Copyright (c) 2006-2007 Gentoo Foundation
3 uberlord 1.1 # Distributed under the terms of the GNU General Public License v2
4     # Contributed by Roy Marples (uberlord@gentoo.org)
5    
6     # If we have a service specific script, run this now
7 uberlord 1.4 if [ -x /etc/openvpn/"${SVCNAME}"-down.sh ] ; then
8 uberlord 1.6 /etc/openvpn/"${SVCNAME}"-down.sh "$@"
9 uberlord 1.1 fi
10    
11 uberlord 1.3 # Restore resolv.conf to how it was
12 uberlord 1.6 if [ "${PEER_DNS}" != "no" ]; then
13     if [ -x /sbin/resolvconf ] ; then
14     /sbin/resolvconf -d "${dev}"
15     elif [ -e /etc/resolv.conf-"${dev}".sv ] ; then
16     # Important that we copy instead of move incase resolv.conf is
17     # a symlink and not an actual file
18     cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf
19     rm -f /etc/resolv.conf-"${dev}".sv
20     fi
21 uberlord 1.3 fi
22 uberlord 1.1
23     # Re-enter the init script to start any dependant services
24     if /etc/init.d/"${SVCNAME}" --quiet status ; then
25     export IN_BACKGROUND=true
26     /etc/init.d/"${SVCNAME}" --quiet stop
27     fi
28    
29     exit 0
30    
31     # vim: ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20