mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-05-03 01:13:05 +08:00
feat: optimize project file structure
This commit is contained in:
14
docker/etc/cont-init.d/010-old-compatible
Normal file
14
docker/etc/cont-init.d/010-old-compatible
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
function __old_compatible {
|
||||
|
||||
umask ${UMASK}
|
||||
|
||||
if [ -f /config/bangumi.json ]; then
|
||||
mv /config/bangumi.json /app/data/bangumi.json
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
__old_compatible 2>&1 | sed "s#^#cont-init: info: $(realpath $0): &#g"
|
||||
13
docker/etc/cont-init.d/020-fixuser
Normal file
13
docker/etc/cont-init.d/020-fixuser
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
function __fixuser {
|
||||
|
||||
groupmod -o -g "${PGID}" ab
|
||||
usermod -o -u "${PUID}" ab
|
||||
|
||||
chown ab:ab -R /app /ab
|
||||
|
||||
}
|
||||
|
||||
__fixuser 2>&1 | sed "s#^#cont-init: info: $(realpath $0): &#g"
|
||||
4
docker/etc/services.d/auto_bangumi/finish
Normal file
4
docker/etc/services.d/auto_bangumi/finish
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
pkill -f 'python3 main.py'
|
||||
1
docker/etc/services.d/auto_bangumi/notification-fd
Normal file
1
docker/etc/services.d/auto_bangumi/notification-fd
Normal file
@@ -0,0 +1 @@
|
||||
3
|
||||
16
docker/etc/services.d/auto_bangumi/run
Normal file
16
docker/etc/services.d/auto_bangumi/run
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
umask ${UMASK}
|
||||
|
||||
if [ -f /app/config/config.json ]; then
|
||||
AB_PORT=$(jq '.program.webui_port' /app/config/config.json)
|
||||
elif [ -f /app/config/config_dev.json ]; then
|
||||
AB_PORT=$(jq '.program.webui_port' /app/config/config_dev.json)
|
||||
else
|
||||
AB_PORT=7892
|
||||
fi
|
||||
|
||||
exec \
|
||||
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${AB_PORT}" \
|
||||
cd /app s6-setuidgid ab python3 main.py
|
||||
Reference in New Issue
Block a user