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