1#!/usr/local/bin/bash 2 3SCRIPT=$(readlink -f "$0") 4UPGRADEDIR=$(dirname "${SCRIPT}") 5INSTALLPATH=$(dirname "${UPGRADEDIR}") 6TOPDIR=$(dirname "${INSTALLPATH}") 7 8seahub_secret_keygen=${INSTALLPATH}/seahub/tools/secret_key_generator.py 9seahub_settings_py=${TOPDIR}/seahub_settings.py 10 11line="SECRET_KEY = \"$(python3.8 $seahub_secret_keygen)\"" 12 13sed -i.bak -e "/SECRET_KEY/c\\ 14$line 15" $seahub_settings_py 16