1
0
Fork 0
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:
ljf 2021-04-08 20:30:50 +02:00 committed by ljf (zamentur)
parent 400b4c5725
commit 51cf595323

View file

@ -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