MullvadConnectivity.prj.xml

MullvadConnectivity.prj.xml

A Tasker project that switches between wireguard connections based on wifi status. Also available as a gist.

For full context, see the original blog post, “Network Routing and Automation Fun with pfsense, Wireguard, and Tasker“.

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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<TaskerData sr="" dvi="1" tv="5.15.14">
	<Profile sr="prof11" ve="2">
		<cdate>1625582573422</cdate>
		<edate>1648008026635</edate>
		<flags>8</flags>
		<id>11</id>
		<mid0>12</mid0>
		<nme>At Home</nme>
		<State sr="con0" ve="2">
			<cname>At Home</cname>
			<code>165</code>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%CURRENTWIFI</lhs>
					<op>4</op>
					<rhs>HomeSsidName*</rhs>
				</Condition>
			</ConditionList>
		</State>
	</Profile>
	<Profile sr="prof3" ve="2">
		<cdate>1625579572978</cdate>
		<clp>true</clp>
		<edate>1648008036438</edate>
		<flags>8</flags>
		<id>3</id>
		<mid0>4</mid0>
		<nme>Not At Home</nme>
		<pri>7</pri>
		<State sr="con0" ve="2">
			<cname>Not At Home</cname>
			<code>165</code>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%CURRENTWIFI</lhs>
					<op>5</op>
					<rhs>HomeSsidName*</rhs>
				</Condition>
			</ConditionList>
		</State>
	</Profile>
	<Profile sr="prof7" ve="2">
		<cdate>1634673691379</cdate>
		<clp>true</clp>
		<edate>1648095617900</edate>
		<flags>8</flags>
		<id>7</id>
		<mid0>6</mid0>
		<nme>Wifi Connected</nme>
		<State sr="con0" ve="2">
			<code>160</code>
			<Str sr="arg0" ve="3"/>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Int sr="arg3" val="2"/>
		</State>
	</Profile>
	<Profile sr="prof9" ve="2">
		<cdate>1634673764893</cdate>
		<clp>true</clp>
		<edate>1647991418639</edate>
		<flags>8</flags>
		<id>9</id>
		<mid0>2</mid0>
		<nme>Wifi Disconnected</nme>
		<State sr="con0" ve="2">
			<code>160</code>
			<pin>true</pin>
			<Str sr="arg0" ve="3"/>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3"/>
			<Int sr="arg3" val="2"/>
		</State>
	</Profile>
	<Project sr="proj0" ve="2">
		<cdate>1630802812790</cdate>
		<name>MullvadConnectivity</name>
		<pids>9,11,3,7</pids>
		<tids>12,2,6,4,5</tids>
		<Img sr="icon" ve="2">
			<nme>cust_animal_panda</nme>
		</Img>
	</Project>
	<Task sr="task12">
		<cdate>1625582588223</cdate>
		<edate>1648095565640</edate>
		<id>12</id>
		<nme>Switch To Mullvad</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>365</code>
			<se>false</se>
			<Bundle sr="arg0">
				<Vals sr="val">
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
				</Vals>
			</Bundle>
			<Str sr="arg1" ve="3">WireGuardSetTunnel(false,home)</Str>
		</Action>
		<Action sr="act1" ve="7">
			<code>365</code>
			<se>false</se>
			<Bundle sr="arg0">
				<Vals sr="val">
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
				</Vals>
			</Bundle>
			<Str sr="arg1" ve="3">WireGuardSetTunnel(true,mullvad-home) </Str>
		</Action>
	</Task>
	<Task sr="task2">
		<cdate>1634672433088</cdate>
		<edate>1648007995825</edate>
		<id>2</id>
		<nme>Fake SSID</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>547</code>
			<Str sr="arg0" ve="3">%CURRENTWIFI</Str>
			<Str sr="arg1" ve="3">None</Str>
			<Int sr="arg2" val="0"/>
			<Int sr="arg3" val="0"/>
			<Int sr="arg4" val="0"/>
			<Int sr="arg5" val="3"/>
			<Int sr="arg6" val="1"/>
		</Action>
	</Task>
	<Task sr="task4">
		<cdate>1625579587280</cdate>
		<edate>1648095584287</edate>
		<id>4</id>
		<nme>Switch To Home VPN</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>365</code>
			<se>false</se>
			<Bundle sr="arg0">
				<Vals sr="val">
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
				</Vals>
			</Bundle>
			<Str sr="arg1" ve="3">WireGuardSetTunnel(false,mullvad-home)</Str>
		</Action>
		<Action sr="act1" ve="7">
			<code>365</code>
			<Bundle sr="arg0">
				<Vals sr="val">
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
				</Vals>
			</Bundle>
			<Str sr="arg1" ve="3">WireGuardSetTunnel(true,home)</Str>
		</Action>
	</Task>
	<Task sr="task5">
		<cdate>1634673266146</cdate>
		<edate>1634673438187</edate>
		<id>5</id>
		<nme>Show Ssid</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">%CURRENTWIFI</Str>
			<Int sr="arg1" val="0"/>
			<Str sr="arg10" ve="3"/>
			<Int sr="arg11" val="1"/>
			<Int sr="arg12" val="0"/>
			<Str sr="arg13" ve="3"/>
			<Int sr="arg14" val="0"/>
			<Int sr="arg2" val="0"/>
			<Str sr="arg3" ve="3"/>
			<Str sr="arg4" ve="3"/>
			<Str sr="arg5" ve="3"/>
			<Str sr="arg6" ve="3"/>
			<Str sr="arg7" ve="3"/>
			<Str sr="arg8" ve="3"/>
			<Int sr="arg9" val="1"/>
		</Action>
	</Task>
	<Task sr="task6">
		<cdate>1648007962954</cdate>
		<edate>1648095617900</edate>
		<id>6</id>
		<nme>Get SSID</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>341</code>
			<Int sr="arg0" val="5"/>
			<Str sr="arg1" ve="3"/>
			<Str sr="arg2" ve="3">%CURRENTWIFI</Str>
		</Action>
	</Task>
</TaskerData>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.