You are not logged in.

#1 2018-06-12 05:39:08

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

Automatically check website for changes and notify

I want to check the below website for a change in the IP range that is listed on this page (automatic checks are preferred)

https://support.symantec.com/en_US/arti … 44698.html

It is possible to use either a Windows environment (only CMD and PowerShell are available and it is not possible to install additional software) or, a Linux environment (which is also limited to a shell script, e.g. no additional software can be installed)

What would be a good aproach to the above issue?

Offline

#2 2018-06-12 05:49:49

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automatically check website for changes and notify

What range? There are many of them on that page. You could use curl and awk; both will be on pretty much every flavour of Linux.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-06-12 05:59:36

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

Re: Automatically check website for changes and notify

@jasonwryan

Thanks for the quick reply. The files lists a few IP addresses, as shown below.

IP address range** IP subnet Start End 
148.64.0.0/21** 148.64.0.0/21 148.64.0.1 148.64.7.254 

 


  

 

Auckland, New Zealand IP subnet Start End 
Egress ranges 124.157.113.128/27
 124.157.113.160/27
 124.157.113.192/27 124.157.113.129
 124.157.113.161
 124.157.113.193 124.157.113.158
 124.157.113.190
 124.154.113.222 

 

Chennai, India IP subnet Start End 
Egress ranges 180.179.40.0/26
 180.179.46.64/27
 148.64.6.0/23 180.179.40.1
 180.179.46.65
 148.64.6.1 180.179.40.62
 180.179.46.94
 148.64.7.254 

 

Hong Kong IP subnet Start End 
Egress ranges 103.246.38.0/24
 148.64.0.0/24 103.246.38.1
 148.64.0.1 103.246.38.254
 148.64.0.254 

 

Mumbai, India IP subnet Start End 
Egress ranges 180.179.142.0/24
 148.64.4.0/23 180.179.142.1
 148.64.4.1 180.179.142.254
 148.64.5.254 

 

Seoul, South Korea IP subnet Start End 
Egress range 203.246.168.0/24 203.246.168.1 203.246.168.254 

 

Shanghai, China IP subnet Start End 
Egress ranges 211.147.76.0/27
 211.147.76.32/27 211.147.76.1
 211.147.76.33 211.147.76.30
 211.147.76.62 

 

Singapore IP subnet Start End 
Egress ranges 103.246.37.0/24
 148.64.3.0/24 103.246.37.1
 148.64.3.1 103.246.37.254
 148.64.3.254 

 

Sydney, Australia IP subnet Start End 
Egress range 103.246.36.0/24 103.246.36.1 103.246.36.254 

 

Taipei, Taiwan IP subnet Start End 
Egress range 61.58.46.0/24 61.58.46.1 61.58.46.254 

 

Tokyo, Japan IP subnet Start End 
Egress ranges 
103.9.99.0/24
 103.246.39.0/24
 148.64.1.0/24
 103.9.99.1
 103.246.39.1
 148.64.1.1 103.9.99.254
 103.246.39.254
 148.64.1.254 

Now I would like to get notified if any of these IP addresses change, e.g. Tokyo 103.9.99.1 would change to 102.6.66.2


I have tried the following approach:

#!/bin/bash
#check website for changes

URL="https://support.symantec.com/en_US/article.TECH244698.html"



for (( ; ; )); do
        mv  new.html old.html 2> /dev/null
        curl $URL > new.html
        DIFF_OUTPUT="$(diff new.html old.html)"
        if [ "0" != "${#DIFF_OUTPUT}" ]; then
        echo "changed, visit page at $URL"
fi
sleep 2
done

However, the whole website is not of interest. It is just the part with the IP addresses and then it should ideally display the changed part on the screen.
(This script might get a mailing function as well later on)

Offline

Board footer

Powered by FluxBB