<?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=1572&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / on network-manager, how to run bash script before connecting to wifi?]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=1572</link>
		<description><![CDATA[The most recent posts in on network-manager, how to run bash script before connecting to wifi?.]]></description>
		<lastBuildDate>Wed, 30 Aug 2017 00:45:04 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: on network-manager, how to run bash script before connecting to wifi?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=4835#p4835</link>
			<description><![CDATA[<p>Thanks, garyz, but I don&#039;t use wicd. I use network-manager.</p><p>I figured out a workaround. It doesn&#039;t actually run my script before <em>every</em> wifi connection, but does run the script before connecting to wifi at two critical times: after boot and after resuming from suspend. That&#039;s good enough for what I need.</p><p>Two scripts are required:</p><div class="codebox"><pre><code>#!/bin/bash

# Save this one as /etc/init.d/jobs-preconnect

### BEGIN INIT INFO
# Provides:          jobs-preconnect
# Required-Start:    $remote_fs dbus udev
# Required-Stop:     $remote_fs dbus udev
# Should-Start:	     $syslog
# Should-Stop:       $syslog
# X-Start-Before:    network-manager
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: bruno&#039;s jobs-preconnect
# Description:       jobs to run before network-manager starts
### END INIT INFO

[ &quot;$1&quot; = &quot;start&quot; ] &amp;&amp; /path/to/preconnect/script</code></pre></div><div class="codebox"><pre><code>#!/bin/bash

# Save this one as /etc/pm/sleep.d/33jobs-preconnect

if [[ &quot;$1&quot; = &quot;resume&quot; ]]; then
	service network-manager stop 
	bash /path/to/preconnect/script
	service network-manager start
fi</code></pre></div><p>Then run these commands in a terminal as root:</p><div class="codebox"><pre><code>chown root /etc/init.d/jobs-preconnect
chmod 755 /etc/init.d/jobs-preconnect
update-rc.d jobs-preconnect defaults
chown root /etc/pm/sleep.d/33jobs-preconnect
chmod 755 /etc/pm/sleep.d/33jobs-preconnect</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Wed, 30 Aug 2017 00:45:04 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=4835#p4835</guid>
		</item>
		<item>
			<title><![CDATA[Re: on network-manager, how to run bash script before connecting to wifi?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=4829#p4829</link>
			<description><![CDATA[<p>Well,&#160; not in my experience area -- but is wicd run by a sysvinit script on startup??<br />You know - one of the rc.d type files iwth the numbers in the name for the start/kill priority.</p>]]></description>
			<author><![CDATA[dummy@example.com (garyz.dev1)]]></author>
			<pubDate>Tue, 29 Aug 2017 21:27:27 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=4829#p4829</guid>
		</item>
		<item>
			<title><![CDATA[on network-manager, how to run bash script before connecting to wifi?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=4823#p4823</link>
			<description><![CDATA[<p>I have a bash script that I would like to run just before my system connects to any wireless network. Does anybody know how to accomplish this? I know wicd makes it easy with its &quot;preconnect&quot; directory, but I can&#039;t seem to figure out how to do it with network-manager, which is what I use now.</p><p>I know how to run scripts <strong>after</strong> connecting, but not before. The /etc/NetworkManager/dispatcher.d/pre-up.d directory sounds promising but is not exactly what I&#039;m looking for because those jobs are actually run after the interface is connected:</p><div class="quotebox"><blockquote><div><p>pre-up</p><p>The interface is connected to the network but is not yet fully activated. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, and NetworkManager will wait for script execution to complete before indicating to applications that the interface is fully activated.</p></div></blockquote></div><p>Any ideas?</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Tue, 29 Aug 2017 19:23:47 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=4823#p4823</guid>
		</item>
	</channel>
</rss>
