mirror of
https://github.com/YunoHost-Apps/jirafeau_ynh.git
synced 2024-09-03 19:35:53 +02:00
[fix] Retrieve app settings in upgrade script
This commit is contained in:
parent
0ad486b1e6
commit
54e6f06c3a
2 changed files with 11 additions and 8 deletions
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Treat unset variables as an error
|
||||||
|
set -u
|
||||||
|
|
||||||
# This is a multi-instance app, meaning it can be installed several times independently
|
# This is a multi-instance app, meaning it can be installed several times independently
|
||||||
# The id of the app as stated in the manifest is available as $YNH_APP_ID
|
# The id of the app as stated in the manifest is available as $YNH_APP_ID
|
||||||
# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
|
# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
# Exit on command errors and treat unset variables as an error
|
||||||
set -e
|
set -eu
|
||||||
|
|
||||||
# This is a multi-instance app, meaning it can be installed several times independently
|
# This is a multi-instance app, meaning it can be installed several times independently
|
||||||
# The id of the app as stated in the manifest is available as $YNH_APP_ID
|
# The id of the app as stated in the manifest is available as $YNH_APP_ID
|
||||||
|
@ -15,12 +15,12 @@ set -e
|
||||||
# db names, ...
|
# db names, ...
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve settings
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
path=$YNH_APP_ARG_PATH
|
path=$(sudo yunohost app setting $app path)
|
||||||
admin_user=$YNH_APP_ARG_ADMIN_USER
|
admin_user=$(sudo yunohost app setting $app admin_user)
|
||||||
upload_password=$YNH_APP_ARG_UPLOAD_PASSWORD
|
upload_password=$(sudo yunohost app setting $app upload_password)
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$(sudo yunohost app setting $app is_public)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Remove trailing "/" for next commands
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
|
Loading…
Reference in a new issue