HEX
Server: Apache
System: Linux SH-FR-PM-y8qo 6.6.80-paas #1 SMP PREEMPT_DYNAMIC Thu Sep 25 11:18:23 UTC 2025 x86_64
User: hosting-user (5000)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: //srv/admin/scripts/blowfish_install.sh
#!/bin/bash
# must be run on ${SYS_USER}

# set PATH if WWW_ENGINE is not php
if [ "${WWW_ENGINE}" != "php" ]; then
    if [ -d '/opt/php-8.3' ]; then
        # bookworm, stretch instances
        export PATH="${PATH}:/opt/php-8.3/bin"
    else
        # jessie instance
        export PATH="${PATH}:/opt/php-7.0/bin"
    fi
fi

# create blowfish_secret for phpmyadmin (debian postinst like)
readonly BLOWFISH_FILE="${CUSTOMER_DIR}/var/admin/blowfish_secret.inc.php"

crypt_to_file ()
{
    readonly BLOWFISH_TMP=`mktemp "${LOCAL_DIR}/blowfish.XXXXXXXX"`
    readonly CRYPT=`perl -le 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..32)'`
    printf "<?php\n\$cfg['blowfish_secret'] = '${CRYPT}';\n?>\n" > ${BLOWFISH_TMP}
    install -m 640 ${BLOWFISH_TMP} ${BLOWFISH_FILE}
    rm ${BLOWFISH_TMP}
}

if [ ! -f ${BLOWFISH_FILE} ]; then
    crypt_to_file
else
    readonly CURRENT_SECRET=`php -r 'error_reporting(0); include("'${BLOWFISH_FILE}'"); echo strlen($cfg["blowfish_secret"]);'`
    if [ ${CURRENT_SECRET} -lt 32 ]; then
        rm ${BLOWFISH_FILE}
        crypt_to_file
    fi
fi