mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Fix Jellyfin legacy symlink handling
This commit is contained in:
@@ -10,9 +10,21 @@ create_link() {
|
||||
local target_dir="$1"
|
||||
local link_path="$2"
|
||||
|
||||
local target_real
|
||||
local link_real
|
||||
|
||||
target_real=$(realpath -m "$target_dir")
|
||||
link_real=$(realpath -m "$link_path")
|
||||
|
||||
mkdir -p "$target_dir"
|
||||
mkdir -p "$(dirname "$link_path")"
|
||||
|
||||
# If the link path is the same as the target, just ensure ownership and exit
|
||||
if [ "$target_real" = "$link_real" ]; then
|
||||
chown -R "$PUID:$PGID" "$target_dir"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -L "$link_path" ]; then
|
||||
rm "$link_path"
|
||||
elif [ -d "$link_path" ]; then
|
||||
|
||||
Reference in New Issue
Block a user