Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: 1534