bin sh HOMEDIR pftemp WGETCMD which wget FILE nets TMP tmp WGETCMD -q

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
HOMEDIR="/.1/pftemp"
WGETCMD=`which wget`
FILE="nets"
TMP="tmp"
${WGETCMD} -q -c "http://stat.it.tusur.ru/nets.txt" -O ${HOMEDIR}/${TMP}
if [ -s ${HOMEDIR}/${TMP} ]; then
if [ -e ${HOMEDIR}/${FILE} ]; then
DIFF=`diff -q ${HOMEDIR}/${FILE} ${HOMEDIR}/${TMP}`
if [ -n "${DIFF}" ]; then
cp ${HOMEDIR}/${TMP} ${HOMEDIR}/${FILE}
fi
else
cp ${HOMEDIR}/${TMP} ${HOMEDIR}/${FILE}
fi
rm ${HOMEDIR}/${TMP}
fi