Package: wicd / 1.7.4+tb2-5~deb9u1

26-support_etc-network_scripts.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From: David Paleino <dapal@debian.org>
Subject: support /etc/network/ hierarchy for connection scripts
Bug-Debian: https://bugs.debian.org/579497
Forwarded: no

---
 wicd/networking.py |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Index: wicd/wicd/networking.py
===================================================================
--- wicd.orig/wicd/networking.py	2016-01-25 21:17:02.778306947 +0100
+++ wicd/wicd/networking.py	2016-01-25 21:17:02.770306974 +0100
@@ -220,6 +220,12 @@
             mac = 'X'
         if name in (None, ''):
             name = 'X'
+        os.putenv("MODE", "stop")
+        os.putenv("VERBOSITY", str(int(self.debug)))
+        os.putenv("IFACE", iface.iface)
+        os.putenv("LOGICAL", iface.iface)
+        os.putenv("PHASE", "pre-down")
+        misc.ExecuteScripts('/etc/network/if-down.d/', self.debug)
         misc.ExecuteScripts(wpath.predisconnectscripts, self.debug,
                            extra_parameters=(nettype, name, mac))
         if self.pre_disconnect_script:
@@ -234,6 +240,8 @@
         iface.FlushDNS()
         iface.Down()
         iface.Up()
+        os.putenv("PHASE", "post-down")
+        misc.ExecuteScripts('/etc/network/if-post-down.d/', self.debug)
         misc.ExecuteScripts(wpath.postdisconnectscripts, self.debug,
                             extra_parameters=(nettype, name, mac))
         if self.post_disconnect_script:
@@ -943,6 +951,12 @@
         self.is_connecting = True
         
         # Run pre-connection script.
+        os.putenv("MODE", "start")
+        os.putenv("VERBOSITY", str(int(self.debug)))
+        os.putenv("IFACE", wiface.iface)
+        os.putenv("LOGICAL", wiface.iface)
+        os.putenv("PHASE", "pre-up")
+        self.run_global_scripts_if_needed('/etc/network/if-pre-up.d/')
         self.run_global_scripts_if_needed(wpath.preconnectscripts,
                                           extra_parameters=('wireless',
                                                     self.network['essid'],
@@ -994,6 +1008,8 @@
         self.verify_association(wiface)
         
         # Run post-connection script.
+        os.putenv("PHASE", "post-up")
+        self.run_global_scripts_if_needed('/etc/network/if-up.d/')
         self.run_global_scripts_if_needed(wpath.postconnectscripts,
                                           extra_parameters=('wireless',
                                                     self.network['essid'],
@@ -1212,6 +1228,12 @@
         self.is_connecting = True
 
         # Run pre-connection script.
+        os.putenv("MODE", "start")
+        os.putenv("VERBOSITY", str(int(self.debug)))
+        os.putenv("IFACE", liface.iface)
+        os.putenv("LOGICAL", liface.iface)
+        os.putenv("PHASE", "pre-up")
+        self.run_global_scripts_if_needed('/etc/network/if-pre-up.d/')
         self.run_global_scripts_if_needed(wpath.preconnectscripts,
                                           extra_parameters=('wired', 'wired',
                                                     self.network['profilename'])
@@ -1240,6 +1262,8 @@
         self.set_dns_addresses(liface)
         
         # Run post-connection script.
+        os.putenv("PHASE", "post-up")
+        self.run_global_scripts_if_needed('/etc/network/if-up.d/')
         self.run_global_scripts_if_needed(wpath.postconnectscripts,
                                           extra_parameters=('wired', 'wired',
                                                 self.network['profilename'])