]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/install+setup/install/mountdest.sh
Neue Mount Skripte fuer den Installer - Status untested
[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 " - yes, it is our destination"
18 exit 0
19 fi
20 done
21
22 mount /dev/${DEVICE}1 /cdrom 2> /dev/null
23 if [ ]; then
24 echo -n ${DEVICE} > /tmp/source_device
25 echo "Found Sources in ${DEVICE}"
26 else
27 umount /cdrom 2> /dev/null
28 echo "Found no Sources in ${DEVICE} skipping"
29 fi
30 umount /cdrom 2> /dev/null
31
32
33
34 # scan USB/SCSI devices
35 echo "--> USB/SCSI"
36 for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2 | sort | uniq); do
37 echo -n "---> $DEVICE"
38 mount /dev/${DEVICE}1 /harddisk 2> /dev/null
39 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
40 umount /harddisk 2> /dev/null
41 echo "${DEVICE} is source drive - skipping"
42 continue
43 else
44 umount /harddisk 2> /dev/null
45 echo -n "$DEVICE" > /tmp/dest_device
46 echo " - yes, it is our destination"
47 exit 1
48 fi
49 done
50
51 # scan RAID devices
52 echo "--> RAID"
53 for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2 | sort | uniq); do
54 echo -n "---> $DEVICE"
55 mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
56 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
57 umount /harddisk 2> /dev/null
58 echo "${DEVICE} is source drive - skipping"
59 echo " is source drive"
60 continue
61 else
62 umount /harddisk 2> /dev/null
63 echo -n "$DEVICE" > /tmp/dest_device
64 echo " - yes, it is our destination"
65 exit 2
66 fi
67 done
68
69 exit 10 # Nothing found