Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakpawade committed Mar 14, 2023
0 parents commit c87c076
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Follow these steps:

1. Go to Device Settings from Adguard dashboard.
2. Scroll down and copy the link mentioned below "You can also programmatically update your linked IP address by calling:"
It should lool like this :

https://linkip.adguard-dns.com/linkip/\<deviceid>/\<somerandom_alphanumeric_characterstring>
3. In autolink.bat, replace the aguard_IP_connect_link string with the above link
4. You can replace the browser name on the same line. Just go to the original install folder of the browser and look up what the .exe is called.
5. Search Task Scheduler in windows and open it.
6. Click on Task Scheduler Library and From Actions, choose Create Task
7. Give any relevant name for the task.
8. Select Run only when user is logged on.
9. Go to Triggers -> New, From "Begin the Task" drop down, select "At log on" and press OK
10. Go to Actions -> New, From Action select Start a program and browse autolink.bat file from browser button. Click OK
11. Click OK on the Create Task window.
12. Check if you see the new task in Task Scheduler Library. If you can, then its done. The sript will run after every login.
25 changes: 25 additions & 0 deletions autolink.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@echo off

title Adguard IP link check
echo %CD%
powershell -Command "(Invoke-WebRequest -uri 'https://api.ipify.org').Content.Trim()" > ip.txt
set /p ip=<ip.txt
echo current : %ip%
set /p prev_ip=<prev_ip.txt
echo previous ip : %prev_ip%
if "%ip%" == "" (
echo cannot get current IP. Check connection.
) else (
if "%prev_ip%"=="%ip%" (
REM checking current and previous IP
echo IP address has not changed since last startup.
) else (
REM link new IP to adguard
start firefox.exe aguard_IP_connect_link
REM Saving new IP address to file
echo %ip%>prev_ip.txt
)
)


timeout /t 5
1 change: 1 addition & 0 deletions ip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
103.151.136.41
1 change: 1 addition & 0 deletions prev_ip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
103.151.136.41

0 comments on commit c87c076

Please sign in to comment.