Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/blackosx/trunk/package/Main_Package_Elements/Scripts/CheckFormat.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Check the format of the selected partition"
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"
16fi
17
18if [ "$( fstyp "$targetDevice" | grep hfs )" ]; then
19echo "${targetDevice} is currently formatted as HFS"
20echo "-----------------------------------------------"
21echo ""
22exit 1
23
24fi
25if [ "$( fstyp "$targetDevice" | grep msdos )" ]; then
26echo "${targetDevice} is currently formatted as msdos"
27echo "-----------------------------------------------"
28echo ""
29exit 2
30fi
31
32echo "-----------------------------------------------"
33echo ""
34
35exit 0

Archive Download this file

Revision: 215