source: MondoRescue/branches/stable/mindi/rootfs/sbin/LogIt@ 746

Last change on this file since 746 was 746, checked in by Bruno Cornec, 18 years ago
  • Still trying to fix LABEL + LVM in mindi
  • Removed some X11 files remaining
  • remove some ps options not available with busybox
  • Use LOGFILE constantly in init & LogIt
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1#!/bin/sh
2#
3# $Id: LogIt 746 2006-08-05 10:00:51Z bruno $
4#
5
6# if [ ! -e "/bin/date" ] ; then
7# currdate=""
8# else
9# currdate=`date +%H:%M`
10# fi
11currdate=""
12
13LOGFILE=/tmp/mondo-restore.log
14if [ ! -e "$LOGFILE" ] ; then
15 echo "...first line..." > $LOGFILE
16fi
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
25if [ "$#" = "1" ] ; then
26 echo -e "$currdate $1" >> $LOGFILE
27elif [ "$#" = "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
47else
48 LogIt "LogIt '$1' .. silly params"
49 exit 1
50fi
51
52
53exit 0
Note: See TracBrowser for help on using the repository browser.