[DRBD-cvs] scripts by lars; work around for missing newline on last...
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Thu, 4 Mar 2004 08:38:23 +0100 (CET)
DRBD CVS committal
Author : lars
Project : drbd
Module : scripts
Dir : drbd/scripts
Modified Files:
drbd
Log Message:
work around for missing newline on last line of drbd.conf
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/scripts/drbd,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- drbd 22 Feb 2004 20:42:45 -0000 1.54
+++ drbd 4 Mar 2004 07:38:18 -0000 1.55
@@ -62,7 +62,7 @@
#
# shouldn't there be more descriptive comments? ;)
#
-CVSID='$Id: drbd,v 1.54 2004/02/22 20:42:45 lars Exp $'
+CVSID='$Id: drbd,v 1.55 2004/03/04 07:38:18 lars Exp $'
CONTACT='Lars Ellenberg <l.g.e@web.de>, drbd-user@lists.linbit.com'
##################################################}}}1
@@ -166,7 +166,7 @@
LOGECHO="echo $link:"
LOGERR="echo $link:"
fi
-USLEEP="$(type -p usleep) 100" || USLEEP="sleep 1"
+USLEEP="sleep 1"
# QQQ thought this could be useful
# TERMINAL=/dev/tty
@@ -606,11 +606,15 @@
TOKEN=''
TOKEN_LINE=${TOKEN_LINE##+([$IFS])}
until [ -n "$TOKEN_LINE" ] ; do
- read TOKEN_LINE || return 1
+ read TOKEN_LINE
+ [ $? == 0 -o -n "$TOKEN_LINE" ] || return 1
let TOKEN_LINE_NR=TOKEN_LINE_NR+1
- echo -n .
- [ $((TOKEN_LINE_NR % 60)) == 0 ] && echo
- debug 4 "- $CONFIG %4d: '$TOKEN_LINE'" $TOKEN_LINE_NR
+ if [ $VERBOSITY -lt 4 ] ; then
+ echo -n .
+ [ $((TOKEN_LINE_NR % 60)) == 0 ] && echo
+ else
+ debug 4 "- $CONFIG %4d: '%s'" $TOKEN_LINE_NR "$TOKEN_LINE"
+ fi
# strip comments. a "#" within a word is *not* considered comment
# leader, it *has* to follow a whitespace or be the first character
TOKEN_LINE=${TOKEN_LINE%%@(+([$IFS])|)#*}