]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/install+setup/install/mountdest.sh
Laedt die USB-Controller von allein...
[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"
149a26a8
MT
9 mount /dev/${DEVICE}1 /harddisk 2> /dev/null
10 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
ee78a5ef 11 umount /harddisk 2> /dev/null
149a26a8 12 echo "${DEVICE} is source drive - SKIP"
ee78a5ef 13 continue
149a26a8
MT
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
ee78a5ef
MT
19 fi
20done
21
22# scan USB/SCSI devices
23echo "--> USB/SCSI"
24for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2 | sort | uniq); do
149a26a8 25 echo -n "---> $DEVICE"
ee78a5ef 26 mount /dev/${DEVICE}1 /harddisk 2> /dev/null
149a26a8 27 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
ee78a5ef 28 umount /harddisk 2> /dev/null
149a26a8 29 echo "${DEVICE} is source drive - SKIP"
ee78a5ef 30 continue
149a26a8
MT
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
ee78a5ef
MT
36 fi
37done
38
56b548f1
MT
39# scan RAID devices
40echo "--> RAID"
41for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2 | sort | uniq); do
149a26a8
MT
42 echo -n "---> $DEVICE"
43 mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
44 if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
56b548f1 45 umount /harddisk 2> /dev/null
149a26a8 46 echo "${DEVICE} is source drive - SKIP"
56b548f1 47 continue
149a26a8 48 else
56b548f1
MT
49 umount /harddisk 2> /dev/null
50 echo -n "$DEVICE" > /tmp/dest_device
149a26a8 51 echo "${DEVICE} - yes, it is our destination"
56b548f1
MT
52 exit 2
53 fi
54done
55
ee78a5ef 56exit 10 # Nothing found