1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ztncui_ynh.git synced 2024-09-03 18:06:05 +02:00

Use ynh_add_config for env file in upgrade script

This commit is contained in:
tituspijean 2022-01-15 18:14:52 +01:00
parent 1564917180
commit 4a0d6df2ee
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 8 additions and 10 deletions

View file

@ -121,8 +121,8 @@ popd
#=================================================
# Let's retrieve information on the ZeroTier installation
ZT_TOKEN="$(</var/lib/zerotier-one/authtoken.secret)"
ZT_ADDR="localhost:$(</var/lib/zerotier-one/zerotier-one.port)"
zt_token="$(</var/lib/zerotier-one/authtoken.secret)"
zt_addr="localhost:$(</var/lib/zerotier-one/zerotier-one.port)"
ynh_add_config --template="env" --destination="$final_path/.env"
chown $app:$app "$final_path/.env"

View file

@ -146,15 +146,13 @@ popd
# MODIFY A CONFIG FILE
#=================================================
# Setup env file
mkdir -p $final_path
env_file=$final_path/src/.env
touch $env_file
chmod 600 $env_file
# Let's retrieve information on the ZeroTier installation
zt_token="$(</var/lib/zerotier-one/authtoken.secret)"
zt_addr="localhost:$(</var/lib/zerotier-one/zerotier-one.port)"
echo "ZT_TOKEN=$(</var/lib/zerotier-one/authtoken.secret)" >> $env_file
echo "ZT_ADDR=localhost:$(</var/lib/zerotier-one/zerotier-one.port)" >> $env_file
echo "HTTP_PORT=$port" >> $env_file
ynh_add_config --template="env" --destination="$final_path/.env"
chown $app:$app "$final_path/.env"
chmod 600 "$final_path/.env"
#=================================================
# LINK CERTIFICATES