<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=3730&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Kill openvpn in one line in Terminal]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=3730</link>
		<description><![CDATA[The most recent posts in Kill openvpn in one line in Terminal.]]></description>
		<lastBuildDate>Fri, 18 Dec 2020 04:23:26 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Kill openvpn in one line in Terminal]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=26292#p26292</link>
			<description><![CDATA[<p>Thanks for this. <br />I have been using chattr to prevent DNS leakage <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /><br />Seems like you are doing it the proper way. I just found a way to prevent my resolve.conf from changing on me after setting it. </p><p>Thanks guys I learned a bit from you <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>pkill will be useful for me. <br />Also, as I use public Wifi often the 10.100.0.1 DNS is quite common for cisco routers.&#160; It helps me from manually having to change it all the time.<br />Awesome thank you very much.</p>]]></description>
			<author><![CDATA[dummy@example.com (czeekaj)]]></author>
			<pubDate>Fri, 18 Dec 2020 04:23:26 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=26292#p26292</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kill openvpn in one line in Terminal]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=23976#p23976</link>
			<description><![CDATA[<div class="quotebox"><cite>czeekaj wrote:</cite><blockquote><div><p>Also <strong>you can add local host DNS resolving to the vpn kill script</strong>.</p><div class="codebox"><pre><code>echo &quot;search lan
nameserver 192.168.1.1&quot; &gt; /etc/resolv.conf </code></pre></div></div></blockquote></div><p>Actually, DNS changing can be better accomplished with the openvpn <span class="bbc">up</span> and <span class="bbc">down</span> directives as described <a href="https://dev1galaxy.org/viewtopic.php?id=3698" rel="nofollow">here</a>.</p><p>Install resolvconf packages using the following command.</p><div class="codebox"><pre><code>apt-get install resolvconf</code></pre></div><p>Add the following lines to each .ovpn file to prevent DNS leakage.</p><div class="codebox"><pre><code>script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf</code></pre></div><p>The <span class="bbc">up</span> directive is executed when <span class="bbc">openvpn</span> starts and forces your Devuan box to use the VPN DNS servers to prevent DNS leakage.</p><p>The <span class="bbc">down</span> directive is executed when you kill <span class="bbc">openvpn</span> and returns your Devuan box to using the original DNS, in your case <span class="bbc">192.168.1.1</span>.</p><p>The advantage of using the above method is that if you are mobile and your DNS server IP address changes, the <span class="bbc">down</span> directive will still correctly return your DNS to the original value. Whereas, your script will incorrectly change the DNS IP address to <span class="bbc">192.168.1.1</span> and you will no longer be able to browse the Internet.</p>]]></description>
			<author><![CDATA[dummy@example.com (Vernon)]]></author>
			<pubDate>Tue, 11 Aug 2020 01:12:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=23976#p23976</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kill openvpn in one line in Terminal]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=23896#p23896</link>
			<description><![CDATA[<p>Here&#039;s how to kill openvpn in one line in terminal:</p><div class="codebox"><pre><code>sudo pkill -f openvpn</code></pre></div><p>Depending on how you run openvpn, you may not need the <span class="bbc">-f</span>.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Fri, 07 Aug 2020 19:01:45 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=23896#p23896</guid>
		</item>
		<item>
			<title><![CDATA[Kill openvpn in one line in Terminal]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=23875#p23875</link>
			<description><![CDATA[<p>I finally decided to automate something that had been a bit of a time waster for me.</p><p>nano /usr/local/sbin/Killvpn</p><div class="codebox"><pre><code>#!/bin/bash

openvpn_pid=$(pidof openvpn | awk &#039;{print $1}&#039;)
kill $openvpn_pid</code></pre></div><p>chmod +x /usr/local/sbin/Killvpn</p><p>Also you can add local host DNS resolving to the vpn kill script.</p><div class="codebox"><pre><code>echo &quot;search lan
nameserver 192.168.1.1&quot; &gt; /etc/resolv.conf </code></pre></div><p>Super simple, new to awk but reading a script from GNU user pretty much taught me all I needed to know to get this working. (<br />found out you wont even need awk for something this simple) Thanks <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (czeekaj)]]></author>
			<pubDate>Fri, 07 Aug 2020 02:00:11 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=23875#p23875</guid>
		</item>
	</channel>
</rss>
