Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/diags/graph-this.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

2017-08-28 23:51:44 +02:00
#!/bin/bash
if [ "$FONT" = "" ]
then
FONT=/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf
fi
echo "font : $FONT"
2017-09-26 14:57:35 +02:00
# $1 = program, $2 = filename extension
function graphit()
{
PROG=$1
FNEXT=$2
ls *.$FNEXT 2>/dev/null 1>&2
if [ $? -eq 0 ]; then
for i in *\.$FNEXT
do
PDF=$(echo ${i} | sed "s/$FNEXT$/pdf/")
if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ]
then
PROGOPT="-Tpdf"
case $PROG in
"seqdiag" | "packetdiag" | "nwdiag")
PROGOPT="$PROGOPT -a -f $FONT"
echo ${PROG} ${PROGOPT} ${i}
${PROG} ${PROGOPT} ${i}
;;
"dot")
echo "${PROG} ${PROGOPT} ${i} > ${PDF}"
${PROG} ${PROGOPT} ${i} > ${PDF}
;;
esac
echo touch ${PDF}
touch ${PDF}
fi
done
2017-09-03 15:11:16 +02:00
fi
2017-09-26 14:57:35 +02:00
}
2017-09-03 15:11:16 +02:00
2017-09-26 14:57:35 +02:00
graphit "seqdiag" "diag"
graphit "packetdiag" "pktdiag"
graphit "nwdiag" "nwdiag"
graphit "dot" "gviz-dot"