-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsilent_update.bat
58 lines (50 loc) · 1.68 KB
/
silent_update.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
:start
cd "%~dp0"
echo Start at %date% %time% > silent_update.log
echo Working from %~dp0 >> silent_update.log
IF NOT EXIST "mobile-accessibility-phones.xsl" (
echo %time% No mobile-accessibility-phones.xsl available >> silent_update.log
exit
)
IF NOT EXIST "wget.exe" (
echo %time% No wget.exe available >> silent_update.log
exit
)
IF NOT EXIST "xml.exe" (
echo %time% no xml.exe available >> silent_update.log
exit
)
:checkconnection
wget.exe -q -O NUL "https://www.gari.info/download-gari-db.cfm" >> silent_update.log 2>&1
IF ERRORLEVEL 1 (
echo %time% No connection available >> silent_update.log
exit
)
IF EXIST "mobile-accessibility-phones.html" (
echo %time% Backup mobile-accessibility-phones.html >> silent_update.log
del /F /Q mobile-accessibility-phones.bak.html >> silent_update.log 2>&1
copy /Y mobile-accessibility-phones.html mobile-accessibility-phones.bak.html >> silent_update.log 2>&1
)
:download
echo %time% Download XML >> silent_update.log
wget --output-document=mobile-accessibility-phones.xml http://gari.info/xml/mobile-accessibility-phones.xml >> silent_update.log 2>&1
IF EXIST "mobile-accessibility-phones.xml" (
GOTO cont
) ELSE (
GOTO download
)
:cont
echo %time% Process XML >> silent_update.log
xml.exe tr mobile-accessibility-phones.xsl mobile-accessibility-phones.xml > mobile-accessibility-phones.html
IF EXIST "mobile-accessibility-phones.html" (
echo %time% Clean-up >> silent_update.log
del /F /Q mobile-accessibility-phones.xml >> silent_update.log 2>&1
GOTO end
) ELSE (
GOTO cont
)
:end
del /F /Q *. >> silent_update.log 2>&1
echo %time% Finished. >> silent_update.log
exit