Chameleon

Chameleon Svn Source Tree

Root/branches/blackosx/package/Scripts/Sub/CheckFormat.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "CheckFormat: Is target HFS or MSDOS?"
5echo "**********************************************"
6
7# if the selected partition is formatted as HFS then exit with 1
8# if the selected partition is formatted as MSDOS then exit with 2
9# if fstyp doesn't return a value then exit with 0
10
11# Receives targetDevice: for example, /dev/disk0s2
12# Receives targetVolume: Volume to install to.
13# Receives scriptDir: The location of the main script dir.
14
15
16if [ "$#" -eq 3 ]; then
17targetDevice="$1"
18targetVolume="$2"
19scriptDir="$3"
20echo "DEBUG: passed argument for targetDevice = $targetDevice"
21echo "DEBUG: passed argument for targetVolume = $targetVolume"
22echo "DEBUG: passed argument for scriptDir = $scriptDir"
23else
24echo "Error - wrong number of values passed"
25exit 9
26fi
27
28if [ "$( fstyp "$targetDevice" | grep hfs )" ]; then
29echo "${targetDevice} is currently formatted as HFS"
30echo "-----------------------------------------------"
31echo ""
32#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS"
33exit 1
34
35fi
36if [ "$( fstyp "$targetDevice" | grep msdos )" ]; then
37echo "${targetDevice} is currently formatted as msdos"
38echo "-----------------------------------------------"
39echo ""
40#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos"
41exit 2
42fi
43
44echo "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
45echo "-----------------------------------------------"
46echo ""
47
48"$scriptDir"InstallLog.sh "${targetVolume}" "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
49
50exit 0

Archive Download this file

Revision: 1579