maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   fix maemo-update-resolvconf for openvpn (https://talk.maemo.org/showthread.php?t=76003)

niv 2011-08-23 11:37

fix maemo-update-resolvconf for openvpn
 
below is my fix to make openvpn work with dnsmasq:

gdiff /etc/oprnvpn/maemo-update-resolvconf.orig /etc/openvpn/maemo-update-resolvconf
Code:

20c20,22
<
---
> # $1 is tun0
> [ -z $1 ]&&exit 1
> name=$1
46,49c48,50
<    if [ ! -f /etc/resolv.conf.prevpn ] ; then
<        mv /etc/resolv.conf /etc/resolv.conf.prevpn
<    fi
<    echo -e "$R" > /etc/resolv.conf
---
>    echo -e "$R" > /var/run/resolv.conf.$name
>    pkill -HUP dnsmasq
>    pgrep -f '/usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z' ||/usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z &
53,54c54,57
<    if [ -f /etc/resolv.conf.prevpn ] ; then
<        mv /etc/resolv.conf.prevpn /etc/resolv.conf
---
>    if [ -f /var/run/resolv.conf.$name ] ; then
>        rm /var/run/resolv.conf.$name
>        pkill -HUP dnsmasq
>        pgrep -f '/usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z' ||/usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z

in my /etc/dnsmasq.conf I add
Code:

resolv-file=/var/run/resolv.conf.tun0
I do need to fix the official openvpn package but this is what I got so far

niv 2011-11-05 00:15

Re: fix maemo-update-resolvconf for openvpn
 
I still need to add a line to reload dnsmasq:
pkill -HUP dnsmasq

mikkov 2011-11-05 01:09

Re: fix maemo-update-resolvconf for openvpn
 
resolvconf is not part of the openvpn-applet but openvpn (answering to your request)


All times are GMT. The time now is 16:46.

vBulletin® Version 3.8.8