X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Fpakfire%2Flib%2Fget_mirror.sh;h=2a9e9054c85255c1ab1d4dfab2195067738b2928;hp=5ccf8260e1844dcf62f07b67d1e75e971a1adfdd;hb=e383179bb6e70468b716db30bb8f7854966cbd38;hpb=6d4147d2500d4002754a27501d7ede6f6d6b040f diff --git a/src/pakfire/lib/get_mirror.sh b/src/pakfire/lib/get_mirror.sh index 5ccf8260e1..2a9e9054c8 100644 --- a/src/pakfire/lib/get_mirror.sh +++ b/src/pakfire/lib/get_mirror.sh @@ -1,37 +1,25 @@ -#!/bin/bash - ############################################################################################ # Version 0.1a, Copyright (C) 2006 by IPFire.org # # IPFire ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen. # ############################################################################################ -# Haupt-URL -http=$(get_conf.sh H_MIRROR) - -# Ziel-Verzeichnis -dest=$(get_conf.sh HOME) - -# URL-Zerleger -URL_ZERL=$(get_conf.sh URL_ZERL) - -# Host-Tester -HOST_TEST=$(get_conf.sh HOST_TEST) +get_mirror() { # Testen ob Server erreichbar ist -if ! $HOST_TEST $($URL_ZERL $http get_host) >/dev/null 2>&1 +if ! $HOST_TEST $($URL_ZERL $H_MIRROR get_host) >/dev/null 2>&1 then exit 1 fi # Ins Verzeichnis wechseln -cd $dest +cd $HOME # Überprüfen ob File schon vorhanden ist -if [ -e ${dest}$($URL_ZERL $http get_file) ] - then rm ${dest}$($URL_ZERL $http get_file) +if [ -e $HOME/$($URL_ZERL $H_MIRROR get_file) ] + then rm $HOME/$($URL_ZERL $H_MIRROR get_file) fi # File herunterladen -if /usr/bin/wget -q $http >/dev/null 2>&1 +if /usr/bin/wget -q $H_MIRROR >/dev/null 2>&1 then cd - exit 0 @@ -40,4 +28,5 @@ if /usr/bin/wget -q $http >/dev/null 2>&1 exit 1 fi +} ################################### EOF ####################################################