mirror of
https://github.com/YunoHost-Apps/garage_ynh.git
synced 2024-09-03 18:36:32 +02:00
Attempt to fix config panel ...
This commit is contained in:
parent
ef1b1f1848
commit
e9ca0f074a
2 changed files with 4 additions and 22 deletions
|
@ -19,7 +19,7 @@ version = "1.0"
|
||||||
ask = "allocated space (Gio)"
|
ask = "allocated space (Gio)"
|
||||||
help = "This value is doubled used by yunohost. It set the weight of the garage node and if virtualisation is enabled, it create a virtual disk with the same size"
|
help = "This value is doubled used by yunohost. It set the weight of the garage node and if virtualisation is enabled, it create a virtual disk with the same size"
|
||||||
type = "number"
|
type = "number"
|
||||||
bind = "weight()"
|
bind = "null"
|
||||||
|
|
||||||
[main.garage_conf.bootstrap_peers]
|
[main.garage_conf.bootstrap_peers]
|
||||||
ask = "Friend serveur adress"
|
ask = "Friend serveur adress"
|
||||||
|
|
|
@ -1,31 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#=================================================
|
|
||||||
# GENERIC STARTING
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
|
||||||
node_id=$(ynh_app_setting_get $app node_id)
|
|
||||||
datadir=$(ynh_app_setting_get $app datadir)
|
|
||||||
if [[ "$system_is_inside_container" == "true" ]]
|
if [[ "$system_is_inside_container" == "true" ]]
|
||||||
then
|
then
|
||||||
nbd_index=$(cat $datadir/nbd_index)
|
nbd_index=$(cat $data_dir/nbd_index)
|
||||||
fi
|
fi
|
||||||
command="$final_path/garage -c $final_path/garage.toml"
|
|
||||||
|
|
||||||
get__weight() {
|
command="$install_dir/garage -c $install_dir/garage.toml"
|
||||||
ynh_app_setting_get --app=$app --key=weight
|
|
||||||
}
|
|
||||||
|
|
||||||
set__weight() {
|
set__weight() {
|
||||||
if [[ "$system_is_inside_container" == "true" ]]
|
if [[ "$system_is_inside_container" == "true" ]]
|
||||||
|
@ -45,7 +32,7 @@ set__weight() {
|
||||||
qemu-nbd --disconnect /dev/nbd$nbd_index
|
qemu-nbd --disconnect /dev/nbd$nbd_index
|
||||||
qemu-img resize --shrink $datadir/garage_data.qcow2 "$weight"G
|
qemu-img resize --shrink $datadir/garage_data.qcow2 "$weight"G
|
||||||
fi
|
fi
|
||||||
$final_path/umount_disk.sh
|
$install_dir/umount_disk.sh
|
||||||
systemctl start $app
|
systemctl start $app
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
|
@ -55,11 +42,6 @@ set__weight() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
get__bootstrap_peers() {
|
|
||||||
ynh_app_setting_get --app=$app --key=bootstrap_peers
|
|
||||||
}
|
|
||||||
|
|
||||||
set__bootstrap_peers() {
|
set__bootstrap_peers() {
|
||||||
garage_connect "$command" "$bootstrap_peers" 2>/dev/null
|
garage_connect "$command" "$bootstrap_peers" 2>/dev/null
|
||||||
apply_layout "$command"
|
apply_layout "$command"
|
||||||
|
|
Loading…
Add table
Reference in a new issue