#!/bin/bash
status=$(systemctl show gitea -p ActiveState --value)
if [[ $status == active ]]; then
    systemctl stop gitea
fi
db-make
psql -U $DBUSER -d $DBNAME -f $1
if [[ $status == active ]]; then
    systemctl start gitea
fi