snipe-it/start.sh

22 lines
532 B
Bash
Executable File

#/usr/bin/env bash
set -e
# Retrieve proper environment variables
SNIPEIT_DATA=$(cat .env | grep SNIPEIT_DATA | sed 's/SNIPEIT_DATA=//')
# Start MariaDB first - Snipe-IT doesn't like when the DB is not ready yet
docker compose up -d mariadb
# Wait a couple of seconds that the database is ready
for I in {10..1}; do
printf " ${I}"
sleep 1
done
echo
# Start everything else
docker compose up -d
# Change the logs folder owner (because Snipe-IT really seems to not be able to do it on its own)
chown 100 ${SNIPEIT_DATA}/logs