mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-05-05 15:40:22 +00:00
refactor: Update s6-overlay usage for ms config and start up
Refactor s6 usage based on most recent lsio images
This commit is contained in:
parent
2b60a0f76f
commit
04c9de648d
11 changed files with 22 additions and 15 deletions
33
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/run
Executable file
33
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/run
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# used https://github.com/linuxserver/docker-plex as a template
|
||||
|
||||
POPULATE_EXAMPLES=false
|
||||
|
||||
echo "-------------------------------------"
|
||||
echo -e "Setting up multi-scrobbler config directory based on CONFIG_DIR env: ${CONFIG_DIR}\n"
|
||||
|
||||
# make config folder if it does not exist
|
||||
if [ ! -d "${CONFIG_DIR}" ]; then
|
||||
echo "Directory does not exist! Creating..."
|
||||
POPULATE_EXAMPLES=true
|
||||
mkdir -p "${CONFIG_DIR}"
|
||||
else
|
||||
if [ "$(ls -A ${CONFIG_DIR})" ]; then
|
||||
echo "Directory is not empty, not creating examples."
|
||||
else
|
||||
POPULATE_EXAMPLES=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# add example configs
|
||||
if [ "$POPULATE_EXAMPLES" = true ]; then
|
||||
echo "Directory is empty, adding examples..."
|
||||
cp -r /app/config/. "${CONFIG_DIR}"/
|
||||
fi
|
||||
|
||||
# permissions
|
||||
echo "chown'ing directory to ensure correct permissions."
|
||||
chown -R abc:abc "${CONFIG_DIR}"
|
||||
echo "Done!"
|
||||
echo -e "-------------------------------------\n"
|
||||
1
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/type
Normal file
1
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/type
Normal file
|
|
@ -0,0 +1 @@
|
|||
oneshot
|
||||
1
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/up
Normal file
1
docker/root/etc/s6-overlay/s6-rc.d/init-ms-config/up
Normal file
|
|
@ -0,0 +1 @@
|
|||
/etc/s6-overlay/s6-rc.d/init-ms-config/run
|
||||
Loading…
Add table
Add a link
Reference in a new issue