init_db.sh 397 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. set -e
  3. base_dir=$(
  4. cd "$(dirname "$0")"
  5. pwd
  6. )
  7. cd $base_dir
  8. # Check if stck is running
  9. if systemctl is-active --quiet stck; then
  10. :
  11. else
  12. echo "❌ stck is not running. Please start it first."
  13. exit 1
  14. fi
  15. # Create tables
  16. echo "Creating tables..."
  17. /opt/stck/stck/lib/stck client --queries-file ./init_db.sql
  18. # Done!
  19. echo "✅ stck has been successfully initialized."