9 for webfile
in HTTPFS FTPFS FETCH
11 local url extension dest
12 url
="$(eval echo \"\$\{${webfile}\}\")"
13 extension
="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
17 case "${extension}" in
19 if [ "${extension}" = "iso" ]
21 mkdir
-p "${alt_mountpoint}"
22 dest
="${alt_mountpoint}"
24 dest
="${mountpoint}/${LIVE_MEDIA_PATH}"
25 mount
-t ramfs ram
"${mountpoint}"
28 if [ "${webfile}" = "FETCH" ]
32 ip
="$(dirname $url | sed -e 's|tftp://||g' -e 's|/.*$||g')"
33 rfile
="$(echo $url | sed -e "s|tftp
://$ip||g
")"
34 lfile
="$(basename $url)"
35 log_begin_msg
"Trying tftp -g -b 10240 -r $rfile -l ${dest}/$lfile $ip"
36 tftp
-g -b 10240 -r $rfile -l ${dest}/$lfile $ip
40 log_begin_msg
"Trying wget ${url} -O ${dest}/$(basename ${url})"
41 wget
"${url}" -O "${dest}/$(basename ${url})"
45 log_begin_msg
"Trying to mount ${url} on ${dest}/$(basename ${url})"
46 if [ "${webfile}" = "FTPFS" ]
48 FUSE_MOUNT
="curlftpfs"
49 url
="$(dirname ${url})"
54 $FUSE_MOUNT "${url}" "${dest}"
55 ROOT_PID
="$(minips h -C "$FUSE_MOUNT" | { read x y ; echo "$x" ; } )"
57 [ ${?} -eq 0 ] && rc
=0
58 [ "${extension}" = "tgz" ] && live_dest
="ram"
59 if [ "${extension}" = "iso" ]
61 isoloop
=$
(setup_loop
"${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
62 mount
-t iso9660
"${isoloop}" "${mountpoint}"
69 log_begin_msg
"Unrecognized archive extension for ${url}"
77 if [ -d "${alt_mountpoint}" ]
79 umount
"${alt_mountpoint}"
80 rmdir "${alt_mountpoint}"
82 umount
"${mountpoint}"
83 elif [ "${webfile}" != "FETCH" ] ; then