diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-13 14:08:51 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-13 14:08:51 +0100 |
commit | 34d6fe7f18772f5465bbef9329ab1ae332bd01c4 (patch) | |
tree | 16a2b30140df40a739769e4eb32544053ceac647 /src/fifa.sh | |
parent | 661bd2ee1ddc43bfa5ae59e95494c9ae614cd0ab (diff) |
also log/debuglog to a file
Diffstat (limited to 'src/fifa.sh')
-rwxr-xr-x | src/fifa.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/fifa.sh b/src/fifa.sh index 0dc3900..aab895a 100755 --- a/src/fifa.sh +++ b/src/fifa.sh @@ -3,7 +3,7 @@ ###### Set some default variables or get them from the setup script ###### TITLE="Flexible Installer Framework for Arch linux" LOG="/dev/tty7" - +LOGFILE=/home/arch/fifa/runtime/fifa.log #TODO: maybe we could use a flag to en/disable logging to a file. ###### Miscalleaneous functions ###### @@ -32,15 +32,22 @@ notify () log () { - echo -e "[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@" - echo -e "[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@" >$LOG + str="[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@" + echo -e "$str" + echo -e "$str" > $LOG + echo -e "$str" > $LOGFILE } debug () { - [ "$DEBUG" = "1" ] && echo -e "[DEBUG] $@" - [ "$DEBUG" = "1" ] && echo -e "[DEBUG] $@" >$LOG + str="[DEBUG] $@" + if [ "$DEBUG" = "1" ] + then + echo -e "$str" + echo -e "$str" > $LOG + echo -e "$str" > $LOGFILE + fi } |