From a587dfcd4a223218173cbe37cd6319aac1d41499 Mon Sep 17 00:00:00 2001 From: Hemi03 <55916049+Hemi03@users.noreply.github.com> Date: Wed, 27 Mar 2024 02:07:22 +0100 Subject: [PATCH] fix: bad sed regex --- scripts/config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config b/scripts/config index b1cd441..769c05d 100644 --- a/scripts/config +++ b/scripts/config @@ -94,7 +94,7 @@ END # Remove configuration for unlisted directories pushd $install_dir/smb.conf.d for $directory in $(ls !(0-global).conf); 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/" fi done @@ -119,7 +119,7 @@ set__readonly_dir() { local value for directory in $(echo $directories | sed "s/,/ /g"); do value="no" - if [[ $directory =~ $(echo "^($(echo $readonly_dir | sed s/ /|/g))$") ]]; then + if [[ $directory =~ $(echo "^($(echo $readonly_dir | sed 's/,\| /|/g'))$") ]]; then value="yes" fi ynh_write_var_in_file --file=$install_dir/smb.conf.d/$directory.conf --key="read only" --value="$value" @@ -131,7 +131,7 @@ set__unbrowseable() { local value for directory in $(echo $directories | sed "s/,/ /g"); do value="yes" - if [[ $directory =~ $(echo "^($(echo $unbrowseable | sed s/ /|/g))$") ]]; then + if [[ $directory =~ $(echo "^($(echo $unbrowseable | sed 's/,\| /|/g'))$") ]]; then value="no" fi ynh_write_var_in_file --file=$install_dir/smb.conf.d/$directory.conf --key="browsable" --value="$value"