Skip to content

Commit

Permalink
fix: bind-dirs should create files parent directories if they don't e…
Browse files Browse the repository at this point in the history
…xist
  • Loading branch information
Guiiix committed Feb 19, 2025
1 parent bfe56a8 commit e0003fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vm-systemd/bind-dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ bind_dirs() {
if [ ! -e "$fso_ro" ]; then
## Create empty file or directory if path exists in /rw to allow to bind mount none existing files/dirs.
test -d "$fso_rw" && mkdir --parents "$fso_ro"
test -f "$fso_rw" && touch "$fso_ro"
if [ -f "$fso_rw" ]; then
parent_directory="$(dirname "$fso_ro")"
test -d "$parent_directory" || mkdir --parents "$parent_directory"
touch "$fso_ro"
fi
fi
else
if [ -d "$fso_ro" ] || [ -f "$fso_ro" ]; then
Expand Down

0 comments on commit e0003fc

Please sign in to comment.