core81: set need reboot flag and restart apache.
[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 #
9de3c7f6 5# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
70df8302
MT
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
fab611b3
AF
22#lfs patch source here...
23version=FullIPFireVersion
24#
25
72d80898
MT
26echo "Scanning source media"
27
337726bf
AF
28# scan all Block devices
29for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
30do
149a26a8 31 mount /dev/${DEVICE} /cdrom 2> /dev/null
fab611b3 32 if [ -n "$(ls /cdrom/${version}.media 2>/dev/null)" ]; then
149a26a8 33 echo -n ${DEVICE} > /tmp/source_device
fab611b3 34 echo "Found ${version} on ${DEVICE}"
03df106a 35 exit 0
149a26a8 36 else
fab611b3 37 echo "not found on ${DEVICE} - SKIP"
149a26a8
MT
38 fi
39 umount /cdrom 2> /dev/null
72d80898
MT
40done
41
337726bf
AF
42# scan all Partitions on block devices
43for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
44do
9de3c7f6 45 for DEVICEP in $(ls /dev/${DEVICE}? 2>/dev/null | sed "s/\/dev\///");do
732447b9 46 mount /dev/${DEVICEP} /cdrom 2> /dev/null
fab611b3 47 if [ -n "$(ls /cdrom/${version}.media 2>/dev/null)" ]; then
732447b9 48 echo -n ${DEVICEP} > /tmp/source_device
fab611b3 49 echo "Found ${version} on ${DEVICEP}"
03df106a 50 exit 0
256d83db 51 else
fab611b3 52 echo "not found on ${DEVICEP} - SKIP"
256d83db
AF
53 fi
54 umount /cdrom 2> /dev/null
732447b9 55 done
256d83db
AF
56done
57
337726bf
AF
58# scan all Partitions on raid/mmc devices
59for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
60do
9de3c7f6 61 for DEVICEP in $(ls /dev/${DEVICE}p? 2>/dev/null | sed "s/\/dev\///");do
337726bf 62 mount /dev/${DEVICEP} /cdrom 2> /dev/null
fab611b3 63 if [ -n "$(ls /cdrom/${version}.media 2>/dev/null)" ]; then
337726bf 64 echo -n ${DEVICEP} > /tmp/source_device
fab611b3 65 echo "Found ${version} on ${DEVICEP}"
03df106a 66 exit 0
149a26a8 67 else
fab611b3 68 echo "not found on ${DEVICEP} - SKIP"
149a26a8
MT
69 fi
70 umount /cdrom 2> /dev/null
337726bf 71 done
72d80898
MT
72done
73
03df106a 74exit 10