mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-11 16:40:32 +02:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
3539f328fb
commit
f5428e0950
@@ -7,14 +7,14 @@ set -e
|
||||
######################
|
||||
|
||||
if bashio::config.has_value "PUID"; then
|
||||
PUID="$(bashio::config 'PUID')"
|
||||
PUID="$(bashio::config 'PUID')"
|
||||
else
|
||||
PUID=0
|
||||
PUID=0
|
||||
fi
|
||||
if bashio::config.has_value "PGID"; then
|
||||
PGID="$(bashio::config 'PGID')"
|
||||
PGID="$(bashio::config 'PGID')"
|
||||
else
|
||||
PGID=0
|
||||
PGID=0
|
||||
fi
|
||||
|
||||
##########################
|
||||
@@ -23,7 +23,7 @@ fi
|
||||
|
||||
# Clean typesense
|
||||
if [ -d /data/typesense ]; then
|
||||
rm -r /data/typesense
|
||||
rm -r /data/typesense
|
||||
fi
|
||||
|
||||
#################
|
||||
@@ -34,9 +34,9 @@ bashio::log.info "Setting data location"
|
||||
DATA_LOCATION="$(bashio::config 'data_location')"
|
||||
export IMMICH_MEDIA_LOCATION="$DATA_LOCATION"
|
||||
if [ -d /var/run/s6/container_environment ]; then
|
||||
printf "%s" "$DATA_LOCATION" >/var/run/s6/container_environment/IMMICH_MEDIA_LOCATION
|
||||
printf "%s" "$DATA_LOCATION" > /var/run/s6/container_environment/IMMICH_MEDIA_LOCATION
|
||||
fi
|
||||
printf "%s\n" "IMMICH_MEDIA_LOCATION=\"$DATA_LOCATION\"" >>~/.bashrc
|
||||
printf "%s\n" "IMMICH_MEDIA_LOCATION=\"$DATA_LOCATION\"" >> ~/.bashrc
|
||||
|
||||
echo "... check $DATA_LOCATION folder exists"
|
||||
mkdir -p "$DATA_LOCATION"
|
||||
@@ -63,32 +63,32 @@ chmod 777 /data
|
||||
####################
|
||||
|
||||
if bashio::config.has_value "library_location"; then
|
||||
LIBRARY_LOCATION="$(bashio::config 'library_location')"
|
||||
bashio::log.info "Setting library location to $LIBRARY_LOCATION. This will not move any of your files, you'll need to do this manually"
|
||||
mkdir -p "$LIBRARY_LOCATION"
|
||||
chown -R "$PUID":"$PGID" "$LIBRARY_LOCATION"
|
||||
LIBRARY_LOCATION="$(bashio::config 'library_location')"
|
||||
bashio::log.info "Setting library location to $LIBRARY_LOCATION. This will not move any of your files, you'll need to do this manually"
|
||||
mkdir -p "$LIBRARY_LOCATION"
|
||||
chown -R "$PUID":"$PGID" "$LIBRARY_LOCATION"
|
||||
|
||||
# Check if the existing library is a directory and not a symlink and has contents
|
||||
if [ -d "$DATA_LOCATION/library" ] && [ ! -L "$DATA_LOCATION/library" ] && [ "$(ls -A "$DATA_LOCATION/library")" ]; then
|
||||
bashio::log.yellow "-------------------------------"
|
||||
bashio::log.warning "Library folder in $DATA_LOCATION/library already exists, is a real folder, and is not empty. Moving to $DATA_LOCATION/library_old"
|
||||
bashio::log.yellow "-------------------------------"
|
||||
mv "$DATA_LOCATION/library" "$DATA_LOCATION/library_old"
|
||||
sleep 5
|
||||
fi
|
||||
# Check if the existing library is a directory and not a symlink and has contents
|
||||
if [ -d "$DATA_LOCATION/library" ] && [ ! -L "$DATA_LOCATION/library" ] && [ "$(ls -A "$DATA_LOCATION/library")" ]; then
|
||||
bashio::log.yellow "-------------------------------"
|
||||
bashio::log.warning "Library folder in $DATA_LOCATION/library already exists, is a real folder, and is not empty. Moving to $DATA_LOCATION/library_old"
|
||||
bashio::log.yellow "-------------------------------"
|
||||
mv "$DATA_LOCATION/library" "$DATA_LOCATION/library_old"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Create symbolic link only if it doesn't already exist or is incorrect
|
||||
if [ ! -L "$DATA_LOCATION/library" ] || [ "$(readlink -f "$DATA_LOCATION/library")" != "$LIBRARY_LOCATION" ]; then
|
||||
ln -sf "$LIBRARY_LOCATION" "$DATA_LOCATION/library"
|
||||
fi
|
||||
# Create symbolic link only if it doesn't already exist or is incorrect
|
||||
if [ ! -L "$DATA_LOCATION/library" ] || [ "$(readlink -f "$DATA_LOCATION/library")" != "$LIBRARY_LOCATION" ]; then
|
||||
ln -sf "$LIBRARY_LOCATION" "$DATA_LOCATION/library"
|
||||
fi
|
||||
fi
|
||||
|
||||
##################
|
||||
# REDIS LOCATION #
|
||||
##################
|
||||
|
||||
echo "sed -i \"s=/config/redis=/data/redis=g\" /etc/s6*/s6*/*/run" >>/docker-mods
|
||||
echo "sed -i \"s=/config/log/redis=/data/log=g\" /etc/s6*/s6*/*/run" >>/docker-mods
|
||||
echo "sed -i \"s=/config/redis=/data/redis=g\" /etc/s6*/s6*/*/run" >> /docker-mods
|
||||
echo "sed -i \"s=/config/log/redis=/data/log=g\" /etc/s6*/s6*/*/run" >> /docker-mods
|
||||
mkdir -p /data/redis
|
||||
mkdir -p /data/log
|
||||
chmod 777 /data/redis
|
||||
|
||||
Reference in New Issue
Block a user