Chameleon

Chameleon Svn Source Tree

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

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "InstallLog: Create/Append installation log"
5echo "**********************************************"
6
7# Writes to the Chameleon_Installer_Log.txt file created
8# by the preinstall script at the start of installation.
9
10# Receives two parameters
11# $1 = selected volume for location of the install log
12# $2 = text to write to the installer log
13
14if [ "$#" -eq 2 ]; then
15logLocation="$1"
16verboseText="$2"
17echo "DEBUG: passed argument = ${logLocation}"
18echo "DEBUG: passed argument = ${verboseText}"
19else
20echo "Error - wrong number of values passed"
21exit 9
22fi
23
24
25
26logName="Chameleon_Installer_Log.txt"
27logFile="${logLocation}"/$logName
28
29
30if [ -f "${logFile}" ]; then
31
32# Append messages to the log as passed by other scripts.
33if [ "${verboseText}" = "Diskutil" ]; then
34diskutil list >>"${logFile}"
35echo "======================================================" >>"${logFile}"
36fi
37
38if [ "${verboseText}" = "LineBreak" ]; then
39echo "======================================================" >>"${logFile}"
40fi
41
42if [[ "${verboseText}" == *fdisk* ]]; then
43targetDiskRaw="${verboseText#fdisk *}"
44fdisk $targetDiskRaw >>"${logFile}"
45echo " " >>"${logFile}"
46fi
47
48if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then
49echo "${verboseText}" >> "${logFile}"
50fi
51fi
52
53exit 0

Archive Download this file

Revision: 1642