Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
admin
/
scripts
/
//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