From 01521816b58acc50c17669ccff14df7ae2389f3a Mon Sep 17 00:00:00 2001 From: Hemi03 <55916049+Hemi03@users.noreply.github.com> Date: Fri, 29 Mar 2024 05:44:08 +0100 Subject: [PATCH] fix: write changes in smb.conf.d actualy to config file --- scripts/config | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/scripts/config b/scripts/config index c389875..ed670c9 100644 --- a/scripts/config +++ b/scripts/config @@ -21,6 +21,19 @@ ynh_abort_if_errors data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#================================================= +# recreate the smb.conf from smb.conf.d +#================================================= +write_smb_conf() { + cat > $install_dir/smb.conf <> $install_dir/smb.conf +} #================================================= @@ -36,10 +49,10 @@ set__directories() { for directory in $(echo $directories | sed "s/,/ /g"); do # Create yunohost permission - if ! ynh_permission_exists --permission=$directory ; then + if ! ynh_permission_exists --permission=$directory ; then ynh_permission_create --permission="$directory" --allowed=all_users --show_tile=false fi - + # Create the directory mkdir -p $data_dir/$directory @@ -75,15 +88,8 @@ END fi done - cat > $install_dir/smb.conf <> $install_dir/smb.conf - #--------------------------------------------- # IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too #--------------------------------------------- @@ -100,6 +106,7 @@ set__readonly_dir() { ynh_write_var_in_file --file=$install_dir/smb.conf.d/$directory.conf --key="read only" --value="$value" done ynh_app_setting_set $app readonly_dir $readonly_dir + write_smb_conf } set__unbrowseable() { @@ -113,6 +120,7 @@ set__unbrowseable() { done ynh_app_setting_set $app unbrowseable $unbrowseable + write_smb_conf } #================================================= # GENERIC FINALIZATION