Last change
on this file since 3423 was 764, checked in by Bruno Cornec, 18 years ago |
merge -r728:763 $SVN_M/branches/stable
|
-
Property svn:keywords
set to
Id
|
File size:
1.3 KB
|
Rev | Line | |
---|
[1] | 1 | #!/bin/sh
|
---|
[764] | 2 | #
|
---|
| 3 | # $Id: LogIt 764 2006-08-07 22:34:37Z bruno $
|
---|
| 4 | #
|
---|
[1] | 5 |
|
---|
| 6 | # if [ ! -e "/bin/date" ] ; then
|
---|
| 7 | # currdate=""
|
---|
| 8 | # else
|
---|
| 9 | # currdate=`date +%H:%M`
|
---|
| 10 | # fi
|
---|
| 11 | currdate=""
|
---|
| 12 |
|
---|
[764] | 13 | LOGFILE=/tmp/mondo-restore.log
|
---|
| 14 | if [ ! -e "$LOGFILE" ] ; then
|
---|
| 15 | echo "...first line..." > $LOGFILE
|
---|
| 16 | fi
|
---|
[1] | 17 |
|
---|
| 18 | # LogIt $phrase ------ log only
|
---|
| 19 | # LogIt $phrase 1 ---- log & display
|
---|
| 20 | # LogIt $phrase 2 ---- log & display w/o LF
|
---|
| 21 | # LogIt $prhase 3 ---- log & display, blanking the current screen line
|
---|
| 22 | # before displaying message _with_ LF
|
---|
| 23 | # LogIt $phrase 9 ---- log IF --verbose is ON
|
---|
| 24 |
|
---|
| 25 | if [ "$#" = "1" ] ; then
|
---|
| 26 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 27 | elif [ "$#" = "2" ] ; then
|
---|
| 28 | if [ "$2" = "0" ] ; then
|
---|
| 29 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 30 | elif [ "$2" = "1" ] ; then
|
---|
| 31 | echo -e "$1"
|
---|
| 32 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 33 | elif [ "$2" = "2" ] ; then
|
---|
| 34 | echo -e -n " \r$1\r"
|
---|
| 35 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 36 | elif [ "$2" = "3" ] ; then
|
---|
| 37 | echo -e -n " \r$1\n"
|
---|
| 38 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 39 | elif [ "$2" = "9" ] ; then
|
---|
| 40 | if [ "$DEBUGGING" = "yes" ] ; then
|
---|
| 41 | echo -e "$currdate $1" >> $LOGFILE
|
---|
| 42 | fi
|
---|
| 43 | else
|
---|
| 44 | LogIt "LogIt '$1' '$2' .. unknown 2nd param"
|
---|
| 45 | exit 1
|
---|
| 46 | fi
|
---|
| 47 | else
|
---|
| 48 | LogIt "LogIt '$1' .. silly params"
|
---|
| 49 | exit 1
|
---|
| 50 | fi
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.