HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/trac_theflexguy_com_trac/contrib/workflow/showworkflow
#!/bin/bash -x

basedir=`dirname $0`
options=""
while [ $# -gt 1 ]; do
    options="$options $1"
    shift
done
config="$1"
if [ ! -e "$config" ]; then
    echo "Syntax error: requires a .ini file to work with." >&2
    exit 1
fi

dot=`echo "$config" | sed 's/\.ini$/.dot/g'`
ps=`echo "$config" | sed 's/\.ini$/.ps/g'`
pdf=`echo "$config" | sed 's/\.ini$/.pdf/g'`
png=`echo "$config" | sed 's/\.ini$/.png/g'`

$basedir/workflow_parser.py $options "$config" > "$dot"
if [ $? -ne 0 ]; then
    echo "Failed to parse \"$config\", exiting." >&2
    exit 1
fi

dot -T png -o "$png" "$dot"
dot -T ps -o "$ps" "$dot" && ps2pdf "$ps" "$pdf" || exit 1
kpdf "$pdf"