Format shell scripts

This commit is contained in:
Eric Nemchik 2023-01-15 09:49:10 -06:00
parent 2dca492b1a
commit 6cffb0c447
2 changed files with 5 additions and 3 deletions

View File

@ -1,13 +1,14 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
mkdir -p \
/config/phpmyadmin \
/app/www/public/tmp
if [ ! -f /config/phpmyadmin/config.secret.inc.php ]; then
cat > /config/phpmyadmin/config.secret.inc.php <<EOT
cat >/config/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' </dev/urandom | fold -w 32 | head -n 1)';
EOT
fi

View File

@ -1,10 +1,11 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
DEFAULT_CONF="/config/nginx/site-confs/default.conf"
OLD_ROOT="root /app/phpmyadmin;"
NEW_ROOT="root /app/www/public;"
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null;then
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null; then
echo "updating root in ${DEFAULT_CONF}"
sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}"
fi