Browse Source

added basic error checking to db-load script

pull/3/head
Mar Alegre 4 years ago
parent
commit
f484cd53db
  1. 11
      gitea/assets/bin/db-load
  2. 6
      nextcloud/assets/bin/db-load

11
gitea/assets/bin/db-load

@ -1,10 +1,9 @@
#!/bin/bash #!/bin/bash
status=$(systemctl show gitea -p ActiveState --value)
if [[ $status == active ]]; then if [[ ! -f $1 ]]; then
systemctl stop gitea >&2 echo "Error: could not find file \"$1\""
exit 2
fi fi
db-make db-make
psql -U $DBUSER -d $DBNAME -f $1 psql -U $DBUSER -d $DBNAME -f $1
if [[ $status == active ]]; then
systemctl start gitea
fi

6
nextcloud/assets/bin/db-load

@ -1,3 +1,9 @@
#!/bin/bash #!/bin/bash
if [[ ! -f $1 ]]; then
>&2 echo "Error: could not find file \"$1\""
exit 2
fi
db-make db-make
psql -U $DBUSER -d $DBNAME -f $1 psql -U $DBUSER -d $DBNAME -f $1

Loading…
Cancel
Save