hiya
I've rewritten fai-do-scripts a bit, so that it shows the current
script's runtime if $verbose is set. I found it quite useful in
order to single out "time-hoggers" and streamline my installation procedure.
tschüß
thomas
--- original/live/filesystem.dir/usr/bin/fai-do-scripts 2008-10-28
10:40:08.000000000 +0100
+++ patched/live/filesystem.dir/usr/bin/fai-do-scripts 2008-11-27
21:56:19.360772868 +0100
@@ -110,6 +110,8 @@
[ "$debug" ] && shelldebug="bash -x" ;;
esac
+ TIMESTART=$(date +%s)
+ SKIPECHO=0
case $filetype in
*"POSIX shell script"*|*"executable shell script"*|*"/bash
script"*|*"Bourne shell script"*|*"Bourne-Again shell script"*)
@@ -147,8 +149,14 @@
fc_check_status $file $? | tee -a $LOGDIR/expect.log
;;
- *) echo "File $file has unsupported type $filetype." ;;
+ *) echo "File $file has unsupported type $filetype."
+ SKIPECHO=1
+ ;;
esac
+ let DTIME=$(date +%s)-${TIMESTART}
+ if [ "$verbose" = 1 ] && [ "$SKIPECHO" = 0 ] ; then
+ echo " runtime: ${DTIME} seconds" | tee -a $LOGDIR/shell.log
+ fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
usage() {