Commit a33e1fe0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update dns scripts

parent 7b629165
#!/bin/sh #!/bin/sh
mkdir -p whois-cache . functions.sh
print_whois()
{
if [ ! -s "whois-cache/$1" ] ; then
sleep 1
if ! whois "$1" > "whois-cache/$1" ; then
echo "no WHOIS for $1" >&2
rm -f "whois-cache/$1"
return 1
fi
fi
cat "whois-cache/$1"
return
}
for i in /var/lib/bind/zone/* ; do for i in /var/lib/bind/zone/* ; do
[ -d "$i" ] && continue [ -d "$i" ] && continue
......
#!/bin/sh
# id=175225 name=abz-asphalt.ru account=ООО «Этерсофт» (etersoft) expire=2017-03-27 autoperiod=- domainstatus=2
cat domains.nb | sed -e "s|.*name=\(.*\) account=.*expire=\(.*\) autoperiod.*|\1 \2|g"
#!/bin/sh
. functions.sh
get_created()
{
print_whois $1 | \
case $1 in
*.org|*.com|*.net)
# Creation Date: 2011-09-21T06:11:25Z
grep "^Creation Date" | head -n1 | sed -e "s|Creation Date: \(.*\)T.*|\1|g"
;;
*.ru)
# created: 2014.01.16
grep "^created:" | head -n1 | sed -e "s|.*created:[[:space:]]*\(.*\)|\1|g" | sed -e "s|\.|-|g"
;;
default)
cat >/dev/null
echo "not handled"
;;
esac
}
get_ns()
{
print_whois $1 | grep -q -i "ns[1|4].etersoft.ru"
}
get_pay()
{
case $1 in
*.org|*.com|*.net)
echo "800"
;;
*.ru)
echo "300"
;;
default)
echo "800"
;;
esac
}
prev_year()
{
local YEAR=$(echo $1 | sed "s|-.*||g")
local PREVYEAR=$(($YEAR - 1))
echo $1 | sed -e "s|^$YEAR|$PREVYEAR|g"
}
diff_year()
{
local YEAR1=$(echo $1 | sed "s|-.*||g")
local YEAR2=$(echo $2 | sed "s|-.*||g")
echo "$(($YEAR2-$YEAR1))"
}
echo >domains.csv
echo "!Type:Bank" >domains.qif
cat < domains.itl.txt | while read domain expire ; do
IP=$(resolve -s $domain)
pay=$(get_pay $domain)
printf "%25s %s %s %2s %s\n" $domain $(get_created $domain) $expire $(diff_year $(get_created $domain) $expire) $IP
# "16.01.2016","ITLibertas домены","","За домен axiography.com по 200","","","Интернет","T","","N","-200.00 руб","","-200.00","","",""
echo "$(prev_year $expire), Домен ITLibertas $domain стоимость $pay, $pay, Расход:Интернет" >> domains.csv
cat <<EOF >> domains.qif
D$(prev_year $expire)
T-$pay.00
Домен ITLibertas $domain стоимость $pay
^
EOF
done
#!/bin/sh
print_whois()
{
mkdir -p whois-cache
if [ ! -s "whois-cache/$1" ] ; then
sleep 1
if ! whois "$1" > "whois-cache/$1" ; then
echo "no WHOIS for $1" >&2
rm -f "whois-cache/$1"
return 1
fi
fi
cat "whois-cache/$1"
return
}
#!/bin/sh
# https://www.nic.ru/manager/docs/partners/protocol/access_list_domains.shtml
user=etersoft
passwd=$(cat /home/share/Внутренние/netbreeze-passwd)
curl "https://my.netbreeze.net/billmgr?out=text&authinfo=$user:$passwd&func=domain" > domains.nb
#!/bin/sh
# https://www.nic.ru/manager/docs/partners/protocol/access_list_domains.shtml
user=etersoft
passwd=$(cat /home/share/Внутренние/netbreeze-passwd)
curl "https://my.netbreeze.net/billmgr?out=text&authinfo=$user:$passwd&func=domain.sublist&elid=etersoft.com"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment