summaryrefslogtreecommitdiffstats
path: root/initramfs/stage3-stuff/etc/functions
diff options
context:
space:
mode:
authorSebastian Schmelzer2008-09-24 19:19:16 +0200
committerSebastian Schmelzer2008-09-24 19:19:16 +0200
commitbfac9d6e56ee14b6ad5e9ff524f1215e8edc134f (patch)
tree033b6f3f57d14599321e5ac1a3b7bbc8f44b4859 /initramfs/stage3-stuff/etc/functions
parent * minor fixes (diff)
downloadcore-bfac9d6e56ee14b6ad5e9ff524f1215e8edc134f.tar.gz
core-bfac9d6e56ee14b6ad5e9ff524f1215e8edc134f.tar.xz
core-bfac9d6e56ee14b6ad5e9ff524f1215e8edc134f.zip
* changed fileget() to use tftp wrapper function
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2244 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/stage3-stuff/etc/functions')
-rw-r--r--initramfs/stage3-stuff/etc/functions26
1 files changed, 13 insertions, 13 deletions
diff --git a/initramfs/stage3-stuff/etc/functions b/initramfs/stage3-stuff/etc/functions
index a0f1c6c5..e71a9815 100644
--- a/initramfs/stage3-stuff/etc/functions
+++ b/initramfs/stage3-stuff/etc/functions
@@ -301,29 +301,29 @@ fi
tftp_get () {
local file="$1"
local file_server="$2"
- local download_successfull=false
+ local download_successful=0
local countdown="$3"
[ -z "$1" -o -z "$2" ] && \
- echo "Usage: tftp_get <path> <server> [count]" &&
- return 0;
+ echo "[tftp_get] Usage: tftp_get <path> <server> [count]" &&
+ return 1;
[ "$countdown" = "" ] && countdown=3
- echo "tftp_get trying to get \"$file\" from \"$file_server\"..."
+ echo "[tftp_get] trying to get \"$file\" from \"$file_server\"..."
- until ! [ $download_successfull ]
+ until [ $download_successful -eq 1 ]
do
- [ "$countdown" = "0" ] && return 0;
+ [ "$countdown" = "0" ] && echo "[tftp_get] ..failed!" && return 0;
tftp -g -r $file -l /tmp/$(basename $file) $file_server
- [ -s /tmp/$(basename $file) ] && download_successfull=true
+ [ -s /tmp/$(basename $file) ] && download_successful=1
countdown=`expr $countdown - 1`
usleep 200000
- ! [ "$countdown" = "0" ] && [ $download_successfull ] && \
- echo "retry.."
+ ! [ "$countdown" = "0" ] && [ $download_successful -eq 0 ] && \
+ echo "[tftp_get] retry.."
done
-
- return 1;
+ echo "[tftp_get] ..successful!"
+ return 0;
}
fileget () {
@@ -352,7 +352,7 @@ $filepath, fileserv:$fileserv" >>$LOGFILE
umount /dev/$ldev
;;
*)
- tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
+ tftp_get $cfgfile $fileserv \
&& unpack /tmp/$(basename $cfgfile) 2>>$LOGFILE
;;
esac
@@ -375,7 +375,7 @@ $filepath, fileserv:$fileserv" >>$LOGFILE
2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; }
;;
tftp)
- tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
+ tftp_get $cfgfile $fileserv \
2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; }
;;
esac