]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/install+setup/install/mountdest.sh
Neue Mount Skripte fuer den Installer - Status untested
[people/teissler/ipfire-2.x.git] / src / install+setup / install / mountdest.sh
CommitLineData
ee78a5ef
MT
1#!/bin/sh
2
3echo "Scanning for possible destination drives"
4
5# scan IDE devices
6echo "--> IDE"
7for 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
e3f4dd9c 10 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
ee78a5ef 11 umount /harddisk 2> /dev/null
e3f4dd9c 12 echo "${DEVICE} is source drive - skipping"
ee78a5ef
MT
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
20done
21
e3f4dd9c
CS
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
ee78a5ef
MT
34# scan USB/SCSI devices
35echo "--> USB/SCSI"
36for 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
e3f4dd9c 39 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
ee78a5ef 40 umount /harddisk 2> /dev/null
e3f4dd9c 41 echo "${DEVICE} is source drive - skipping"
ee78a5ef
MT
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
49done
50
56b548f1
MT
51# scan RAID devices
52echo "--> RAID"
53for 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
e3f4dd9c 56 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
56b548f1 57 umount /harddisk 2> /dev/null
e3f4dd9c 58 echo "${DEVICE} is source drive - skipping"
56b548f1
MT
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
67done
68
ee78a5ef 69exit 10 # Nothing found