-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(hammerspoon): temporary ip link on NextDNS
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
-- pcall(require, "types.hammerspoon") | ||
|
||
-- local logger = hs.logger.new("personal", "info") | ||
local logger = hs.logger.new("personal", "verbose") | ||
|
||
logger.i("loading personal tag settings") | ||
|
||
local linkIPURL = os.getenv("NEXTDNS_LINK_IP_URL") | ||
|
||
if linkIPURL == nil or linkIPURL:len() <= 0 then | ||
logger.w("NEXTDNS_LINK_IP_URL unset or empty, skipping reachability callback") | ||
else | ||
hs.network.reachability.forAddress("172.24.174.4"):setCallback(function(self, flags) | ||
if (flags & hs.network.reachability.flags.isLocalAddress) > 0 then | ||
logger.i("VPN is up!") | ||
hs.http.get(linkIPURL, nil) | ||
else | ||
logger.i("VPN is down!") | ||
end | ||
end):start() | ||
end |
2 changes: 2 additions & 0 deletions
2
private_dot_config/exact_private_environment.d/private_global.conf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{- /* cspell:disable */ -}} | ||
NEXTDNS_LINK_IP_URL={{ .global.nextDNSLinkIPURL }} |