mirror of
https://github.com/YunoHost-Apps/borgserver_ynh.git
synced 2024-09-03 20:36:20 +02:00
[fix] Add default value for new params
This commit is contained in:
parent
34c8a64afa
commit
903b8426fe
1 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,9 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
ssh_user=$(ynh_app_setting_get --app=$app --key=ssh_user)
|
ssh_user=$(ynh_app_setting_get --app=$app --key=ssh_user)
|
||||||
|
public_key=$(ynh_app_setting_get --app=$app --key=public_key)
|
||||||
|
alert_delay=$(ynh_app_setting_get --app=$app --key=alert_delay)
|
||||||
|
alert_mails=$(ynh_app_setting_get --app=$app --key=alert_mails)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF AN UPGRADE IS NEEDED
|
# CHECK IF AN UPGRADE IS NEEDED
|
||||||
|
@ -59,6 +62,12 @@ if echo "$public_key" | grep -q -v ' '; then
|
||||||
ynh_app_setting_set --app=$app --key=public_key --value="$(grep -Po 'no-user-rc \K.*$' /home/$ssh_user/.ssh/authorized_keys)"
|
ynh_app_setting_set --app=$app --key=public_key --value="$(grep -Po 'no-user-rc \K.*$' /home/$ssh_user/.ssh/authorized_keys)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Alert delay and alert mail missing
|
||||||
|
if [ -z "$alert_delay" ]; then
|
||||||
|
ynh_app_setting_set --app=$app --key=alert_delay --value=1
|
||||||
|
ynh_app_setting_set --app=$app --key=alert_mails --value="root"
|
||||||
|
fi
|
||||||
|
|
||||||
# Reinstall borg if debian change of major version
|
# Reinstall borg if debian change of major version
|
||||||
if [ ! -f "/opt/borg-env/$(ynh_get_debian_release)" ] ; then
|
if [ ! -f "/opt/borg-env/$(ynh_get_debian_release)" ] ; then
|
||||||
ynh_secure_remove /opt/borg-env
|
ynh_secure_remove /opt/borg-env
|
||||||
|
|
Loading…
Reference in a new issue