1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garage_ynh.git synced 2024-09-03 18:36:32 +02:00

add message for long configuration

add delay for node id
This commit is contained in:
oiseauroch 2023-02-22 16:03:01 +01:00
parent 85b629b5fc
commit b8b788372f

View file

@ -253,8 +253,11 @@ chown $app:$app "$final_path/garage.toml"
#================================================= #=================================================
# CREATE DATA DIRECTORY # CREATE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1 ynh_script_progression --message="Creating a data directory..." --weight=5
if [ "$virtualisation" = "true" ]
then
ynh_print_warn --message="This may take time regarding disk size…"
fi
### Use these lines if you need to create a directory to store "persistent files" for the application. ### Use these lines if you need to create a directory to store "persistent files" for the application.
### Usually this directory is used to store uploaded files or any file that won't be updated during ### Usually this directory is used to store uploaded files or any file that won't be updated during
### an upgrade and that won't be deleted during app removal unless "--purge" option is used. ### an upgrade and that won't be deleted during app removal unless "--purge" option is used.
@ -405,11 +408,15 @@ garage_command="$final_path/garage -c $final_path/garage.toml"
node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1) node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
# sometimes server need some time to start # sometimes server need some time to start
if [ -n "$node_id" ] until [ -n "$node_id" ] ; do
i=$(( i + 1 ))
if [ $i -gt 30 ]
then then
sleep 5 ynh_die --message="unable to get node id"
node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
fi fi
sleep 1
node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
done
ynh_app_setting_set --app=$app --key=node_id --value=$node_id ynh_app_setting_set --app=$app --key=node_id --value=$node_id