function <log> should be defined before being called

This commit is contained in:
Mirko Vogt committed 2010-05-02 23:27:11 +02:00
1 parent 99c6c73272
commit f2f94633da
1 file changed
+5 -5
+5 -5
View File
@@ -89,6 +89,11 @@ fi
mkdir -p ${WORKING_DIR}
date > "${LOG_FILE}" # purge logfile if exists
function log() {
echo "$1"
echo "$1" >> "${LOG_FILE}"
}
function abort() {
log "$1"
log "==="
@@ -96,11 +101,6 @@ function abort() {
exit 1
}
function log() {
echo "$1"
echo "$1" >> "${LOG_FILE}"
}
[ "$(whoami)" == "root" ] || abort "this script must be run as root"
log "working dir: ${WORKING_DIR}"