mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
29 lines
699 B
Bash
Executable File
29 lines
699 B
Bash
Executable File
#!/usr/bin/env bashio
|
|
|
|
##################
|
|
# SYMLINK CONFIG #
|
|
##################
|
|
|
|
if [ ! -d /share/plex ]; then
|
|
echo "Creating /share/plex"
|
|
mkdir -p /share/plex
|
|
fi
|
|
|
|
if [ ! -d /share/plex/Library ]; then
|
|
echo "moving Library folder"
|
|
mv /config/Library /share/plex
|
|
ln -s /share/plex/Library /config
|
|
echo "links done"
|
|
else
|
|
rm -r /config/Library
|
|
ln -s /share/plex/Library /config
|
|
echo "Using existing config"
|
|
fi
|
|
|
|
# Adapt permissions if needed
|
|
if ! bashio::config.true "skip_permissions_check" && [ "${PUID:-0}" != "0" ] && [ "${PGID:-0}" != "0" ]; then
|
|
bashio::log.info "Updating permissions"
|
|
chown -R "$PUID:$PGID" /share/plex
|
|
chmod -R 777 /share/plex
|
|
fi
|