Ip Watch Dog as Kill Switch on Ip lost

This Topic again, was a bit busy so here a new try.

It is quite easy with c# and stable. But i get an dmged ssd so the script is lost and i have to rewirite the 3 h work and 10 lines.

A great feature Bonus for cheating multi client

regards,
Sven

Thank you for your feedback. If I remember correctly, your feature request is already on the TODO list but no luck to work on it. I’ll review it again when I get a chance.

i have done it with rest api and Powershell wih 10 lnes of code. I will post it, when my computer is up again.

@echo off
cls

for /f %%a in ('powershell Invoke-RestMethod api.ipify.org') do set PublicIPOrg=%%a

:loop
timeout /t 60 > null

for /f %%a in ('powershell Invoke-RestMethod api.ipify.org') do set PublicIPNew=%%a

if %PublicIPNew:~0,2% == 169 goto loop

if %PublicIPOrg% NEQ %PublicIPNew% (
shutdown /s /t 30
goto :eof
)
goto loop

powershell versiion follows. this one inst good. becasue cmd and powershell do not work good together.

:slight_smile: Thank you for this code. When I reviewed this powershell script, it seems you used shutdown command to turn off your computer.

I’ll check it again when I try to implement it in Mudfish.

here comes the powershell version:

    #$myoldip = New-Object string[] 10
<# 
For ($i=0; $i -le (10-1); $i++) {
$myoldip[$i] = Invoke-RestMethod api.ipify.org
Write-Host "Meine Anfangs IP: $myoldip"
Start-Sleep -Seconds 1
}
$myoldip
#>
$myoldip = Invoke-RestMethod api.ipify.org
Write-Host "Meine Anfangs IP: $myoldip"

while ($True)
    {
    $myip = Invoke-RestMethod api.ipify.org
    $zeit = (Get-Date).ToString("HH:mm:ss")
    cls 
    Write-Host "$zeit -- Meine Anfangs IP: $myoldip und die aktuelle IP $myip"

    if ( $myIP -ne $myoldip) {
        
        shutdown /s
        pause
        break
    }


    Start-Sleep -Seconds 10
    }`Preformatted text`
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.