#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
#!/bin/bash cd / usr / share / cacti flagdate =$ ( date "+%Y-%m-%d %H:00" ) flagfile =yandex.flag touch $flagfile -d " $flagdate " if [ ! -e index.html -o index.html -ot $flagfile ] ; then wget http: // weather.yandex.ru / 27612 / -O index.html > / dev / null 2 >& 1 fi day =$ 1 pos =$ ( cat index.html | grep "<th class= \" weekday \" >" -A1 | grep -o "<th class= \" week[^0-9]*[0-9]*[^0-9]*</th>" | grep -o "[0-9]*" | grep $day -n | grep -o "^[0-9]" ) let pos =pos+ 1 res =$ ( cat index.html | grep "<tr class= \" data day \" >" -A1 | grep -o "+[0-9]*" | sed -n " $pos " "p" ) echo $res | grep -o "[0-9]*"
Source: https://habr.com/ru/post/62312/