mirror of
https://github.com/dockur/windows.git
synced 2025-06-25 17:07:47 +00:00
Prevent shared directory names from being duplicated
Prevent directory duplication and add index mechanism
This commit is contained in:
parent
eb8775bec7
commit
c3f5af3761
@ -88,10 +88,12 @@ addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"
|
||||
|
||||
IFS=',' read -r -a dirs <<< "${SHARED_DIRS:-}"
|
||||
# Traverse the directory and create shares
|
||||
index_dir=1
|
||||
for dir in "${dirs[@]}"; do
|
||||
if [ -d "$dir" ]; then
|
||||
dir_name=$(basename "$dir")
|
||||
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
|
||||
addShare "$dir" "${dir_name}_${index_dir}" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
|
||||
((index_dir++))
|
||||
fi
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user