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
29#echo "DEBUG: ${targetDevice} is currently formatted as HFS"
30#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS"
31exit 1
32
33fi
34if [ "$( fstyp "$targetDevice" | grep msdos )" ]; then
35#echo "DEBUG: ${targetDevice} is currently formatted as msdos"
36#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos"
37exit 2
38fi
39
40#echo "DEBUG: WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
41"$scriptDir"InstallLog.sh "${targetVolume}" "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
42
43exit 0

Archive Download this file

Revision: 1615