#!/usr/bin/env bash DBNAME="testing4" if sudo -u postgres -i sh -c "psql -q ${DBNAME} -c '\q'" 2>&1; then echo "Database ${DBNAME} exists. Dropping and recreating from dump." sudo -u postgres -i sh -c "dropdb "$DBNAME"" || true sudo -u postgres -i sh -c "createdb "$DBNAME" ag_gen" psql -q "$DBNAME" < schema.sql else echo "Database ${DBNAME} does not exist. Creating and importing from dump." sudo -u postgres -i sh -c "createdb "$DBNAME" ag_gen" psql -q "$DBNAME" < schema.sql fi #sudo -u postgres -i sh -c "dropdb ag_gen" || true #sudo -u postgres -i sh -c "createdb ag_gen ag_gen" #psql ag_gen < schema.sql #./ag_gen -n ../car_examples/generic_timeline_maintenance.nm -x ../car_examples/tmp.xp -g DOTFILE.dot -t 1 -q 1 #./ag_gen -n ../car_examples/generic_maintenance.nm -x ../car_examples/generic_maintenance.xp -g DOTFILE.dot -t 1 -q 1 ./ag_gen -n ../fpga_examples/Network_1/car_network1.nm -x ../fpga_examples/Network_1/car_network1.xp -g DOTFILE.dot -t 1 -q 1 -p -a .20 -m 1 -z "$DBNAME" #./ag_gen -n ../car_examples/generic_timeline_maintenance.nm -x ../car_examples/sync_timeline_maintenance.xp -g DOTFILE.dot -t 1 -q 1 # python3 ../tools/color_code.py ../build/states.txt DOTFILE.dot new.dot #dot -Tsvg new.dot > ag.svg dot -Tsvg DOTFILE.dot > ag.svg