Navigáció átugrása.
Címlap

Abevjava (automata) frissítés windows & linux !transparens proxyval

Az abevjava +proxy +autoupdate probléma HUP.hu-n való felvetése során kapott hasznos információk alapján készítettem windowshoz frissítő szkriptet. Amit aztán már automatikusan ütemezett feladatként is futtathatjuk nap mint nap.
A futtatáshoz kell a UnxUtils pár modulja (cut, grep, wget) ezeket, másoljuk a abevjava_update mappájába. A [/file] sorban cserljük ki a [-ezt <-erre, ]-ezt >-erre.


rem @echo off
@echo --- Abevjava Update start ---------------------------
date /T
x:
cd \abevjava_update\
mkdir files
del /q files\abev_new.wget
del /q files\abev_new-install.bat
del /q files\*.jar
del /q abev_update.tmp
del /q abev_update1.tmp
del /q abev_new.xml
set http_proxy=xxx.xxx.xxx.xxx:xxx
wget -O abev_new.xml http://www.apeh.hu/abev/abev_new
grep -E "jar[/file]$" abev_new.xml | cut -d">" -f2 | cut -d"<" -f1 > abev_update.tmp
grep -E "jar[/file]$" abev_new.xml | cut -d">" -f2 | cut -d"<" -f1 | cut -d"/" -f4 > abev_update1.tmp
for /F %%h in (abev_update.tmp) do @echo http://www.apeh.hu%%h >> files/abev_new.wget
for /F %%h in (abev_update1.tmp) do @echo java -jar %%h -s >> files/abev_new-install.bat
cd files
..\wget -i abev_new.wget
@call abev_new-install.bat
cd ..
@echo --- Abevjava Update End ---------------------------

És itt egy linuxos megvalósítás is.

#!/bin/sh
mkdir files
rm files/abev_new.wget
rm files/abev_new-install.bat
rm files/*.jar
wget -O abev_new.xml http://www.apeh.hu/abev/abev_new
for i in `grep -E "jar[/file]$" abev_new.xml | cut -d">" -f2 | cut -d"<" -f1`; do
echo "http://www.apeh.hu""$i" >> files/abev_new.wget
echo "java -jar ""$(echo "$i" | cut -d"/" -f4)"" -s" >> files/abev_new-install.bat
done
cd files
wget -i abev_new.wget
sh abev_new-install.bat