Merge pull request #24 from linuxserver/format

Format shell scripts
This commit is contained in:
Eric Nemchik 2023-01-15 10:46:28 -06:00 committed by GitHub
commit 326576ba90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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