mirror of
https://github.com/YunoHost-Apps/garage_ynh.git
synced 2024-09-03 18:36:32 +02:00
fix restore script
This commit is contained in:
parent
5ac22dd9d0
commit
ebdb2092f6
1 changed files with 15 additions and 7 deletions
|
@ -33,6 +33,9 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation)
|
virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation)
|
||||||
bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers)
|
bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers)
|
||||||
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
node_id=$(ynh_app_setting_get --app=$app --key=node_id)
|
||||||
|
weight=$(ynh_app_setting_get --app=$app --key=weight)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -142,23 +145,28 @@ yunohost service add --needs_exposed_ports $port --description="s3 storage" --lo
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
|
#recreate log folder
|
||||||
|
mkdir /var/log/$app
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE CONFIGURATION
|
# RECREATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
node_id=$(ynh_app_setting_get --app=$app --key=node_id)
|
|
||||||
weight=$(ynh_app_setting_get --app=$app --key=weight)
|
|
||||||
|
|
||||||
garage_command="$garage_path/garage -c $garage_path/garage.toml"
|
sleep 2
|
||||||
|
|
||||||
|
garage_command="$final_path/garage -c $final_path/garage.toml"
|
||||||
|
|
||||||
|
# define node
|
||||||
|
$garage_command layout assign $node_id -z $domain -c $weight -t $domain
|
||||||
|
# if there is enough node, apply layout
|
||||||
|
apply_layout "$garage_command"
|
||||||
|
|
||||||
if [ -n "$bootstrap_peers" ]
|
if [ -n "$bootstrap_peers" ]
|
||||||
then
|
then
|
||||||
$garage_command id connect "$bootstrap_peers"
|
garage_connect "$garage_command" "$bootstrap_peers"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
init_garage "$garage_command" "$node_id" "$weight" "$domain"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue