Rozdiely pre scripts/php/sk-nic/download.sh medzi verziami 1.2 a 1.3
| verzia 1.2, 2006/08/13 21:47:39 |
verzia 1.3, 2006/08/16 12:12:20 |
|
|
| |
|
| PREFIX="SK-NIC"; |
PREFIX="SK-NIC"; |
| PREFIX_ERR="$PREFIX-ERROR"; |
PREFIX_ERR="$PREFIX-ERROR"; |
| INPUT_FILE="https://www.sk-nic.sk/documents/domeny_1.txt"; |
INPUT_FILE="https://www.sk-nic.sk/documents/domeny_1.txt.gz"; |
| OUTPUT_FILE="data/sk-nic.`date '+%F'`.csv"; |
OUTPUT_FILE="data/sk-nic.`date '+%F'`.csv"; |
| |
WORK_FILE="domeny.tgz"; |
| WGET="`which wget`"; |
WGET="`which wget`"; |
| |
|
| cd "`dirname $0`"; |
cd "`dirname $0`"; |
| Riadok 44 if [ -s "$OUTPUT_FILE" ]; then |
|
| Riadok 45 if [ -s "$OUTPUT_FILE" ]; then |
|
| exit 1; |
exit 1; |
| fi; |
fi; |
| |
|
| $WGET --quiet -O "$OUTPUT_FILE" --no-check-certificate "$INPUT_FILE"; |
$WGET --quiet -O "$WORK_FILE" --no-check-certificate "$INPUT_FILE" \ |
| |
&& zcat "$WORK_FILE" > "$OUTPUT_FILE"; |
| |
|
| if [ "$?" -ne 0 ]; then |
if [ "$?" -ne 0 ]; then |
| echo -ne "$PREFIX_ERR: wget error, see below (wget is $WGET):\n\n"; |
echo -ne "$PREFIX_ERR: wget error, see below (wget is $WGET):\n\n"; |
| $WGET -O "$OUTPUT_FILE" --no-check-certificate "$INPUT_FILE"; |
$WGET -O "$WORK_FILE" --no-check-certificate "$INPUT_FILE"; |
| # pass the exit code from wget |
# pass the exit code from wget |
| exit $?; |
exit $?; |
| fi; |
fi; |
Platon Group <platon@platon.sk> http://platon.sk/
|
|