Shell script to parse subnet ranges

Post Reply
hudatolah
Site Admin
Posts: 143
Joined: Thu Apr 04, 2013 8:10 pm
Are You a Headhunter?: Affirmative
Surfer?: Yes

Shell script to parse subnet ranges

Post by hudatolah » Fri Nov 06, 2020 3:37 pm

Code: Select all

#!/bin/sh
#get_fresh_subnet.sh
#Purpose: Gets fresh list of subnet ranges from a TMS PHP file for ADDM scanning

#clear previous download:
/bin/rm -f get_filtered_subnets_for_ADDM.ph*
/bin/rm -f sort3
/bin/rm -f sorted
/bin/rm -f tmssubnet.csv
#get fresh file:
wget http://telecomportal/Tools/get_filtered_subnets_for_ADDM.php

#parse file for subnet entries only.
grep ":" get_filtered_subnets_for_ADDM.php | cut -d\> -f2 | cut -d: -f1 | tr -s '/' ',' |grep -Ev '^224|^225|^226|^227|^228|^229|^23' > tmssubnet.csv
#
The Blackholesurfer. My surfboard has teeth.

Post Reply