TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login CONVERT LENGTH
login CONVERT TEMPERATURE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login WORK CALCULATOR
login CALCULATE LIFE

Linux commands, scripts, examples, tutorial

Previous articlePage bottomNext article  ALL TOPICS

Linux. whois. DNS check from file bash script

 DNS list is in file $file. After stopping script remembers last ckeck and begins from point, written in tmp.3.com file:
#!/bin/sh

########################################################## params

    word=3
    lang=com

    d=`date +'%m-%d'`
    
    folder=/_scripts/_cron_init/dns
    folderData=$folder
    
    file=$folder/$word.$lang.txt
    result=$folder/$word.$lang.all
    pause=10
    
########################################################## code

    i=0
    continue=` cat $folder/tmp.3.com `
    ((continue=continue-1))
    
if [ $continue -lt 1 ]
then
    > $result

else

cp $result $result.$d
fi
        mv $word.$lang.reg $word.$lang.reg.$d
        mv $word.$lang.pen $word.$lang.pen.$d
        mv $word.$lang.ava $word.$lang.ava.$d

while read line
do

((i=i+1))

   if [ $i -le $continue ]
      then
            echo "continue !!!"
                  continue
      fi
                     

    sleep $pause
    echo $line
    server="whois.internic.org"
    command1=`whois -h $server $line | grep -i -E "(Status|Invalid|Expiration date:)" `
    
    echo  $command1
    
# echo $server

echo $line $command1 $command2 | sed  "s/Status://g" | sed  "s/Expiration Date://g"   >> $result
    
    echo  $i > $folder/tmp.3.com

done < $file

    grep registered $result               > $word.$lang.reg
    grep -E -i "(pending|hold)" $result   > $word.$lang.pen
    grep available $result                > $word.$lang.ava
 
Previous articlePage topNext article  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
A man who is careful with his palate is not likely to be careless with his paragraphs.
Clifton Fadiman
I'll be like Scarlett O'Hara-I'll think about it tomorrow.
Ronald Reagan
Every friend is to the other a sun, and a sunflower also. He attracts and follows.
Jean Paul Richter