mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-26 17:51:48 +01:00
setting API secret
This commit is contained in:
parent
d4448d4652
commit
242b33bc20
@ -133,6 +133,11 @@ WantedBy=multi-user.target
|
||||
exit 0
|
||||
fi
|
||||
|
||||
###################
|
||||
# UPDATE CONFIG
|
||||
###################
|
||||
if [ "$1" = "update-config" ]; then
|
||||
|
||||
###################
|
||||
# UPDATE CONFIG
|
||||
###################
|
||||
@ -153,6 +158,16 @@ if [ "$1" = "update-config" ]; then
|
||||
sed -i "s/^# platform=.*/platform=raspiblitz/g" ./.env
|
||||
sed -i "s/^platform=.*/platform=raspiblitz/g" ./.env
|
||||
|
||||
# configure access token secret
|
||||
secretNeedsInit=$(cat ./.env | grep -c "=please_please_update_me_please")
|
||||
if [ ${secretNeedsInit} > 0 ]; then
|
||||
echo "# init secret ..."
|
||||
secret=$(dd if=/dev/urandom bs=256 count=1 2> /dev/null | shasum -a256 | cut -d " " -f1)
|
||||
sed -i "s/^secret=.*/secret=${secret}/g" ./.env
|
||||
else
|
||||
echo "# secret already initialized"
|
||||
fi
|
||||
|
||||
source /home/admin/raspiblitz.info 2>/dev/null
|
||||
if [ "${setupPhase}" == "done" ]; then
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user