mirror of
https://github.com/YunoHost-Apps/samba_ynh.git
synced 2024-09-03 20:16:27 +02:00
fix: write changes in smb.conf.d actualy to config file
This commit is contained in:
parent
3ae24b6dc9
commit
01521816b5
1 changed files with 18 additions and 10 deletions
|
@ -21,6 +21,19 @@ ynh_abort_if_errors
|
||||||
data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||||
install_dir=$(ynh_app_setting_get --app=$app --key=install_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 <<EOF
|
||||||
|
# =================================================
|
||||||
|
# DO NOT EDIT THIS FILE
|
||||||
|
# EDIT SUBPARTS IN /etc/samba/smb.conf.d
|
||||||
|
# =================================================
|
||||||
|
|
||||||
|
EOF
|
||||||
|
cat $install_dir/smb.conf.d/*.conf >> $install_dir/smb.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -75,14 +88,7 @@ END
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
cat > $install_dir/smb.conf <<EOF
|
write_smb_conf
|
||||||
# =================================================
|
|
||||||
# DO NOT EDIT THIS FILE
|
|
||||||
# EDIT SUBPARTS IN /etc/samba/smb.conf.d
|
|
||||||
# =================================================
|
|
||||||
|
|
||||||
EOF
|
|
||||||
cat $install_dir/smb.conf.d/*.conf >> $install_dir/smb.conf
|
|
||||||
|
|
||||||
#---------------------------------------------
|
#---------------------------------------------
|
||||||
# IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too
|
# 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"
|
ynh_write_var_in_file --file=$install_dir/smb.conf.d/$directory.conf --key="read only" --value="$value"
|
||||||
done
|
done
|
||||||
ynh_app_setting_set $app readonly_dir $readonly_dir
|
ynh_app_setting_set $app readonly_dir $readonly_dir
|
||||||
|
write_smb_conf
|
||||||
}
|
}
|
||||||
|
|
||||||
set__unbrowseable() {
|
set__unbrowseable() {
|
||||||
|
@ -113,6 +120,7 @@ set__unbrowseable() {
|
||||||
done
|
done
|
||||||
ynh_app_setting_set $app unbrowseable $unbrowseable
|
ynh_app_setting_set $app unbrowseable $unbrowseable
|
||||||
|
|
||||||
|
write_smb_conf
|
||||||
}
|
}
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Reference in a new issue