iup: TFTP: Support for specifying the port in the URL (defaults to 69)

This commit is contained in:
Patrik Stridvall 2016-04-18 15:17:37 +02:00
parent 93cd4c477d
commit e63a006822

View file

@ -126,9 +126,14 @@ handle_provisioning() {
if [ ${url%%:*} == "tftp" ]; then if [ ${url%%:*} == "tftp" ]; then
tftpfile=${url#*\/\/} tftpfile=${url#*\/\/}
host=${tftpfile%%\/*} host=${tftpfile%%\/*}
port=${host#*:}
host=${host%%:*}
if [-z ${port} ]; then
port=69
fi
tftpfile=${tftpfile#*\/} tftpfile=${tftpfile#*\/}
/usr/bin/tftp -l $IUPCONFFILES -r "$tftpfile" -g "$host" /usr/bin/tftp -l $IUPCONFFILES -r "$tftpfile" -g "$host" "$port"
else else
get_image "$url" "cat" > $IUPCONFFILES get_image "$url" "cat" > $IUPCONFFILES
fi fi