Fix machinekey generation for deb package

This commit is contained in:
Evgeniy Antonyuk 2023-06-13 14:00:39 +05:00
parent 0f717612c0
commit 27dcc81c28
2 changed files with 3 additions and 4 deletions

View File

@ -219,9 +219,6 @@ set_core_machinekey () {
if [ "$DIST" = "RedHat" ]; then
echo $CORE_MACHINEKEY > $APP_DIR/.private/machinekey
chmod o-rwx $APP_DIR/.private/machinekey
elif [ "$DIST" = "Debian" ]; then
db_set ${PRODUCT}/machinekey $CORE_MACHINEKEY || true
echo ${PRODUCT} ${PRODUCT}/machinekey select $CORE_MACHINEKEY | debconf-set-selections || true
fi
fi

View File

@ -16,7 +16,9 @@ case "$1" in
CORE_MACHINEKEY="$RET"
args+=(-e "$ENVIRONMENT" -ash "$APP_HOST" -asp "$APP_PORT" );
[ -n "$CORE_MACHINEKEY" ] && args+=(-mk "$CORE_MACHINEKEY" );
[ -z "$CORE_MACHINEKEY" ] && CORE_MACHINEKEY=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12) && db_set {{product}}/machinekey $CORE_MACHINEKEY
args+=(-mk "$CORE_MACHINEKEY" )
db_get {{product}}/db-host || true
DB_HOST="$RET"