mirror of
git://slackware.nl/current.git
synced 2025-01-09 05:24:36 +01:00
32 lines
722 B
Text
32 lines
722 B
Text
|
# Determine if there is an ISO image to loop-mount:
|
||
|
check_iso_image () {
|
||
|
local IDIR=$1
|
||
|
local MNTDIR=$2
|
||
|
[ ! -d $IDIR ] && return 1
|
||
|
[ -z "$MNTDIR" ] && MNTDIR=/var/log/mount
|
||
|
|
||
|
IISO=$(ls --indicator-style=none "$IDIR"/slackwar*-install-dvd.iso 2>/dev/null |tail -1)
|
||
|
|
||
|
if [ -n "$IISO" ]; then
|
||
|
cat << EOF > $TMP/tempmsg
|
||
|
|
||
|
An ISO image of Slackware's install DVD was found.
|
||
|
Do you want me to mount the ISO image and use this as the package source?
|
||
|
|
||
|
EOF
|
||
|
dialog --title "USE ISO IMAGE" --yesno "`cat $TMP/tempmsg`" 9 65
|
||
|
RET=$?
|
||
|
if [ ! $RET = 0 ]; then
|
||
|
rm -f $TMP/tempmsg
|
||
|
return 1
|
||
|
fi
|
||
|
|
||
|
rm -f $TMP/tempmsg
|
||
|
umount -f $MNTDIR 2>/dev/null
|
||
|
mkdir -p $MNTDIR
|
||
|
mount -o loop,ro $IISO $MNTDIR
|
||
|
else
|
||
|
return 1
|
||
|
fi
|
||
|
}
|