Skip to content

Commit 01914a0

Browse files
dezhishenxrgzs
andauthored
refactor(ci): add permissions check at docker's entrypoint (#1128)
Co-authored-by: MadDogOwner <[email protected]>
1 parent 6499374 commit 01914a0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

entrypoint.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,23 @@ umask ${UMASK}
55
if [ "$1" = "version" ]; then
66
./openlist version
77
else
8+
# Check file of /opt/openlist/data permissions for current user
9+
# 检查当前用户是否有当前目录的写和执行权限
10+
if [ -d ./data ]; then
11+
if ! [ -w ./data ] || ! [ -x ./data ]; then
12+
cat <<EOF
13+
Error: Current user does not have write and/or execute permissions for the ./data directory: $(pwd)/data
14+
Please visit https://doc.oplist.org/guide/installation/docker#for-version-after-v4-1-0 for more information.
15+
错误:当前用户没有 ./data 目录($(pwd)/data)的写和/或执行权限。
16+
请访问 https://doc.oplist.org/guide/installation/docker#v4-1-0-%E4%BB%A5%E5%90%8E%E7%89%88%E6%9C%AC 获取更多信息。
17+
Exiting...
18+
EOF
19+
exit 1
20+
fi
21+
fi
22+
823
# Define the target directory path for aria2 service
924
ARIA2_DIR="/opt/service/start/aria2"
10-
1125
if [ "$RUN_ARIA2" = "true" ]; then
1226
# If aria2 should run and target directory doesn't exist, copy it
1327
if [ ! -d "$ARIA2_DIR" ]; then

0 commit comments

Comments
 (0)