scripts/bootstrap
Michal Čihař ccc3c2a7c1 Revert "Revert read -r usage"
This reverts commit c34e8a7e40.
2021-02-12 20:22:37 +01:00

47 lines
1 KiB
Bash
Executable file

#!/bin/sh
echo "Weblate domain:"
read -r domain
echo "Weblate title:"
read -r title
if [ -f ~/.config/weblate-bootstrap/sentry_dsn ] ; then
sentry=$(cat ~/.config/weblate-bootstrap/sentry_dsn)
else
echo "Sentry DSN:"
read -r sentry
fi
if [ -f ~/.config/weblate-bootstrap/sentry_token ] ; then
sentry_token=$(cat ~/.config/weblate-bootstrap/sentry_token)
else
echo "Sentry Token:"
read -r sentry_token
fi
echo "Matomo site id:"
read -r matomo
if [ -f ~/.config/weblate-bootstrap/matomo_token ] ; then
matomo_token=$(cat ~/.config/weblate-bootstrap/matomo_token)
else
echo "Matomo token:"
read -r matomo_token
fi
smtp_pass=$(openssl rand -hex 32)
cat > "${1:-/etc/weblate-bootstrap}" <<EOT
WEBLATE_DOMAIN="$domain"
WEBLATE_TITLE="$title"
WEBLATE_SECRET=$(openssl rand -hex 32)
WEBLATE_SENTRY="$sentry"
WEBLATE_SENTRY_TOKEN="$sentry_token"
# Matomo
MATOMO_SITE="$matomo"
MATOMO_TOKEN="$matomo_token"
# Exim
EXIM_PASS=$smtp_pass
# $(openssl passwd -6 "$smtp_pass")
# Postgresql
POSTGRES_PASS=$(openssl rand -hex 32)
EOT