diff --git a/scripts/10-provision.sh b/scripts/10-provision.sh index f40451a..eb3b1b6 100644 --- a/scripts/10-provision.sh +++ b/scripts/10-provision.sh @@ -2,6 +2,9 @@ set -euo pipefail source ./lib.sh +SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +find "$SCRIPTS_DIR/.." -type f -name "*.sh" -exec sed -i 's/\r$//' {} \; || true + log "Pakete installieren …" export DEBIAN_FRONTEND=noninteractive apt-get update -y diff --git a/scripts/80-app.sh b/scripts/80-app.sh index d6b2d47..971d581 100644 --- a/scripts/80-app.sh +++ b/scripts/80-app.sh @@ -166,7 +166,7 @@ sudo -u "$APP_USER" -H bash -lc "cd ${APP_DIR} && php artisan migrate --force" # System-Domain seeden, wenn eine echte Domain gesetzt wurde if [[ "${BASE_DOMAIN}" != "example.com" ]]; then - sudo -u "$APP_USER" -H bash -lc "cd ${APP_DIR} && php artisan db:seed --class=SystemDomainSeeder --no-interaction || true" + sudo -u "$APP_USER" -H bash -lc "cd ${APP_DIR} && php artisan db:seed --class=SystemDomainSeeder --force" fi sudo -u "$APP_USER" -H bash -lc "cd ${APP_DIR} && php artisan config:cache" diff --git a/scripts/99-summary.sh b/scripts/99-summary.sh index 38aad1c..6ed4053 100644 --- a/scripts/99-summary.sh +++ b/scripts/99-summary.sh @@ -2,9 +2,9 @@ set -euo pipefail source ./lib.sh -log(){ printf "\033[1;32m[+]\033[0m %s\n" "$*"; } -ok(){ printf " [\033[1;32mOK\033[0m]\n"; } -fail(){printf " [\033[1;31mFAIL\033[0m]\n"; } +log() { printf "\033[1;32m[+]\033[0m %s\n" "$*"; } +ok() { printf " [\033[1;32mOK\033[0m]\n"; } +fail() { printf " [\033[1;31mFAIL\033[0m]\n"; } APP_USER="${APP_USER:-mailwolt}" APP_GROUP="${APP_GROUP:-www-data}" diff --git a/scripts/lib.sh b/scripts/lib.sh index e85d656..30f395a 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash set -euo pipefail -[ -f /etc/mailwolt/installer.env ] && . /etc/mailwolt/installer.env +if [ -f /etc/mailwolt/installer.env ]; then + set -a + . /etc/mailwolt/installer.env + set +a +fi # ── Styling ──────────────────────────────────────────────────────────────── GREEN="$(printf '\033[1;32m')"; YELLOW="$(printf '\033[1;33m')" RED="$(printf '\033[1;31m')"; CYAN="$(printf '\033[1;36m')"