2010-11-16 03:34:56 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
while [ $# -ge 1 ]; do
|
|
|
|
LOG=$1
|
|
|
|
while read LINE; do
|
|
|
|
case "$LINE" in
|
|
|
|
*got_connect_cmd:\ connName* )
|
|
|
|
CONNNAME="$(echo $LINE | sed 's,^.*connName: "\(.*\)"$,\1,')"
|
|
|
|
;;
|
|
|
|
*hostid* )
|
|
|
|
HOSTID=$(echo $LINE | sed 's,^.*set hostid: \(.\)$,\1,')
|
|
|
|
;;
|
|
|
|
*getChannelSeed:\ channelSeed:*)
|
|
|
|
SEED=$(echo $LINE | sed 's,^.*getChannelSeed: channelSeed: \(.*\)$,\1,')
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < $LOG
|
|
|
|
if [ -z "${CONNNAME}" ]; then
|
|
|
|
echo "CONNNAME not found in $LOG" >&2
|
|
|
|
elif [ -z "${HOSTID}" ]; then
|
|
|
|
echo "HOSTID not found in $LOG" >&2
|
2011-07-01 04:37:37 +02:00
|
|
|
elif [ "${HOSTID}" -eq 0 ]; then
|
|
|
|
echo "HOSTID 0 in $LOG; try later" >&2
|
2010-11-16 03:34:56 +01:00
|
|
|
elif [ -z "${SEED}" ]; then
|
|
|
|
echo "SEED not found in $LOG" >&2
|
|
|
|
else
|
|
|
|
echo ${CONNNAME}/${HOSTID}/${SEED}
|
|
|
|
fi
|
|
|
|
|
|
|
|
shift
|
|
|
|
done
|