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 65464 -r $rfile -l ${dest}/$lfile $ip"
36 tftp
-g -b 65464 -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 if [ -n "${FUSE_MOUNT}" ] && [ -x /bin
/mount.util-linux
]
56 # fuse does not work with klibc mount
57 ln -f /bin
/mount.util-linux
/bin
/mount
61 $FUSE_MOUNT "${url}" "${dest}"
62 ROOT_PID
="$(minips h -C "$FUSE_MOUNT" | { read x y ; echo "$x" ; } )"
64 [ ${?} -eq 0 ] && rc
=0
65 [ "${extension}" = "tgz" ] && live_dest
="ram"
66 if [ "${extension}" = "iso" ]
68 isoloop
=$
(setup_loop
"${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
69 mount
-t iso9660
"${isoloop}" "${mountpoint}"
76 log_begin_msg
"Unrecognized archive extension for ${url}"
84 if [ -d "${alt_mountpoint}" ]
86 umount
"${alt_mountpoint}"
87 rmdir "${alt_mountpoint}"
89 umount
"${mountpoint}"
90 elif [ "${webfile}" != "FETCH" ] ; then