]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/install+setup/install/mountsource.sh
installer: Enhance mountsource.sh script.
[people/teissler/ipfire-2.x.git] / src / install+setup / install / mountsource.sh
CommitLineData
72d80898 1#!/bin/sh
70df8302
MT
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
5# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6# #
7# This program is free software: you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation, either version 3 of the License, or #
10# (at your option) any later version. #
11# #
12# This program is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19# #
20###############################################################################
72d80898 21
72d80898
MT
22echo "Scanning source media"
23
24# scan CDROM devices
ee78a5ef 25for DEVICE in $(kudzu -qps -t 30 -c CDROM | grep device: | cut -d ' ' -f 2 | sort | uniq); do
149a26a8 26 mount /dev/${DEVICE} /cdrom 2> /dev/null
dbf157bb 27 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
149a26a8
MT
28 echo -n ${DEVICE} > /tmp/source_device
29 echo "Found tarball on ${DEVICE}"
03df106a 30 exit 0
149a26a8
MT
31 else
32 echo "Found no tarballs on ${DEVICE} - SKIP"
33 fi
34 umount /cdrom 2> /dev/null
72d80898
MT
35done
36
03df106a 37# scan HD device part1 (usb sticks, etc.)
256d83db 38for DEVICE in $(kudzu -qps -t 30 -c HD | grep device: | cut -d ' ' -f 2 | sort | uniq); do
732447b9
MT
39 for DEVICEP in $(ls /dev/${DEVICE}? | sed "s/\/dev\///");do
40 mount /dev/${DEVICEP} /cdrom 2> /dev/null
dbf157bb 41 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
732447b9
MT
42 echo -n ${DEVICEP} > /tmp/source_device
43 echo "Found tarball on ${DEVICEP}"
03df106a 44 exit 0
256d83db 45 else
732447b9 46 echo "Found no tarballs on ${DEVICEP} - SKIP"
256d83db
AF
47 fi
48 umount /cdrom 2> /dev/null
732447b9 49 done
256d83db
AF
50done
51
03df106a 52# scan HD device unpart (usb sticks, etc.)
9efeb2c4 53for DEVICE in $(kudzu -qps -t 30 -c HD | grep device: | cut -d ' ' -f 2 | sort | uniq); do
03df106a 54 mount /dev/${DEVICE} /cdrom 2> /dev/null
dbf157bb 55 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
03df106a
AF
56 echo -n ${DEVICE} > /tmp/source_device
57 echo "Found tarball on ${DEVICE}"
58 exit 0
149a26a8 59 else
149a26a8
MT
60 echo "Found no tarballs on ${DEVICE} - SKIP"
61 fi
62 umount /cdrom 2> /dev/null
72d80898
MT
63done
64
03df106a 65exit 10