mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-20 04:36:09 +08:00
fix(docker): improve startup process and SIGTERM handling (#1089)
* fix(ci): Modify the way of star OpenList. * fix(ci): start runsvdir
This commit is contained in:
@ -5,11 +5,6 @@ umask ${UMASK}
|
|||||||
if [ "$1" = "version" ]; then
|
if [ "$1" = "version" ]; then
|
||||||
./openlist version
|
./openlist version
|
||||||
else
|
else
|
||||||
# Define the target directory path for openlist service
|
|
||||||
OPENLIST_DIR="/opt/service/start/openlist"
|
|
||||||
if [ ! -d "$OPENLIST_DIR" ]; then
|
|
||||||
cp -r /opt/service/stop/openlist "$OPENLIST_DIR" 2>/dev/null
|
|
||||||
fi
|
|
||||||
# Define the target directory path for aria2 service
|
# Define the target directory path for aria2 service
|
||||||
ARIA2_DIR="/opt/service/start/aria2"
|
ARIA2_DIR="/opt/service/start/aria2"
|
||||||
|
|
||||||
@ -19,12 +14,12 @@ else
|
|||||||
mkdir -p "$ARIA2_DIR"
|
mkdir -p "$ARIA2_DIR"
|
||||||
cp -r /opt/service/stop/aria2/* "$ARIA2_DIR" 2>/dev/null
|
cp -r /opt/service/stop/aria2/* "$ARIA2_DIR" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
runsvdir /opt/service/start &
|
||||||
else
|
else
|
||||||
# If aria2 should NOT run and target directory exists, remove it
|
# If aria2 should NOT run and target directory exists, remove it
|
||||||
if [ -d "$ARIA2_DIR" ]; then
|
if [ -d "$ARIA2_DIR" ]; then
|
||||||
rm -rf "$ARIA2_DIR"
|
rm -rf "$ARIA2_DIR"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
exec ./openlist server --no-prefix
|
||||||
exec runsvdir /opt/service/start
|
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user