]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/install+setup/install/mountdest.sh
gleich die Korrektur hinterher
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / mountdest.sh
1 #!/bin/sh
2
3 echo "Scanning for possible destination drives"
4
5 # scan IDE devices
6 echo "--> IDE"
7 for DEVICE in $(kudzu -qps -t 30 -c HD -b IDE | grep device: | cut -d ' ' -f 2 | sort | uniq); do
8 echo -n "---> $DEVICE"
9 mount /dev/${DEVICE}1 /harddisk 2> /dev/null
10 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
11 umount /harddisk 2> /dev/null
12 echo "${DEVICE} is source drive - skipping"
13 continue
14 else
15 umount /harddisk 2> /dev/null
16 echo -n "$DEVICE" > /tmp/dest_device
17 echo "${DEVICE} - yes, it is our destination"
18 exit 0
19 fi
20 done
21
22 # scan USB/SCSI devices
23 echo "--> USB/SCSI"
24 for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2 | sort | uniq); do
25 echo -n "---> $DEVICE"
26 mount /dev/${DEVICE}1 /harddisk 2> /dev/null
27 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
28 umount /harddisk 2> /dev/null
29 echo "${DEVICE} is source drive - skipping"
30 continue
31 else
32 umount /harddisk 2> /dev/null
33 echo -n "$DEVICE" > /tmp/dest_device
34 echo "${DEVICE} - yes, it is our destination"
35 exit 1
36 fi
37 done
38
39 # scan RAID devices
40 echo "--> RAID"
41 for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2 | sort | uniq); do
42 echo -n "---> $DEVICE"
43 mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
44 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
45 umount /harddisk 2> /dev/null
46 echo "${DEVICE} is source drive - skipping"
47 echo " is source drive"
48 continue
49 else
50 umount /harddisk 2> /dev/null
51 echo -n "$DEVICE" > /tmp/dest_device
52 echo "${DEVICE} - yes, it is our destination"
53 exit 2
54 fi
55 done
56
57 exit 10 # Nothing found