1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/samba_ynh.git synced 2024-09-03 20:16:27 +02:00

fix: could not iterate list

This commit is contained in:
Hemi03 2024-03-26 23:08:45 +01:00
parent 972b733067
commit a424b1ff1f

View file

@ -93,8 +93,7 @@ END
# Remove configuration for unlisted directories # Remove configuration for unlisted directories
pushd $install_dir/smb.conf.d pushd $install_dir/smb.conf.d
for $directory in $(ls !(0-global).conf) for $directory in $(ls !(0-global).conf); do
do
if ! [[ "${directory%.conf}" =~ $(echo "^($(echo $directories | sed s/ /|/g))$") ]]; then if ! [[ "${directory%.conf}" =~ $(echo "^($(echo $directories | sed s/ /|/g))$") ]]; then
ynh_secure_remove "$install_dir/smb.conf.d/" ynh_secure_remove "$install_dir/smb.conf.d/"
fi fi
@ -118,7 +117,7 @@ EOF
set__readonly_dir() { set__readonly_dir() {
local value local value
for directory in $directories; do for directory in $(echo $directories | sed "s/,/ /g"); do
value="no" value="no"
if [[ $directory =~ $(echo "^($(echo $readonly_dir | sed s/ /|/g))$") ]]; then if [[ $directory =~ $(echo "^($(echo $readonly_dir | sed s/ /|/g))$") ]]; then
value="yes" value="yes"
@ -130,7 +129,7 @@ set__readonly_dir() {
set__unbrowseable() { set__unbrowseable() {
local value local value
for directory in $directories; do for directory in $(echo $directories | sed "s/,/ /g"); do
value="yes" value="yes"
if [[ $directory =~ $(echo "^($(echo $unbrowseable | sed s/ /|/g))$") ]]; then if [[ $directory =~ $(echo "^($(echo $unbrowseable | sed s/ /|/g))$") ]]; then
value="no" value="no"