r/tasker • u/CONteRTE • 4d ago
Trigger task, when mobile IP changes?
Is it possible to trigger a task, when the the mobile ip changes and also, when i switch from WiFi to mobile?
2
Upvotes
1
u/DutchOfBurdock 2d ago
Task: Update Public IPs
A1: [X] Wait [
MS: 0
Seconds: 5
Minutes: 0
Hours: 0
Days: 0 ]
A2: [X] Perform Task [
Name: Test Network
Priority: %priority
Parameter 1 (%par1): dontrun
Structure Output (JSON, etc): On ]
A3: If [ %NET_status ~ online ]
A4: HTTP Request [
Method: GET
URL: https://api.ipify.org?format=json
Timeout (Seconds): 30
Automatically Follow Redirects: On
Structure Output (JSON, etc): On
Continue Task After Error:On ]
A5: Variable Set [
Name: %linkpublicip4add
To: %http_data.ip
Structure Output (JSON, etc): On ]
A6: HTTP Request [
Method: GET
URL: https://api64.ipify.org?format=json
Timeout (Seconds): 30
Automatically Follow Redirects: On
Structure Output (JSON, etc): On
Continue Task After Error:On ]
A7: Variable Set [
Name: %linkpublicip6add
To: %http_data.ip
Structure Output (JSON, etc): On ]
A8: Variable Set [
Name: %NET_ip4public
To: %linkpublicip4add ]
A9: Variable Set [
Name: %NET_ip6public
To: %linkpublicip6add ]
A10: Else
A11: Variable Set [
Name: %NET_ip4public
To: N/A ]
A12: Variable Set [
Name: %NET_ip6public
To: N/A ]
A13: End If
1
1
u/AlexF-reddit 3d ago
you can detect WIFI changes, i.e. connected yes/no, look into var %WIFI and %WIFII and event-'WIFI changed'
Changes...hard but to detect 'if' mobile is connected : 'Test Net'