cacode commited on
Commit
bb392c5
·
verified ·
1 Parent(s): d8d83be

Update hf-entrypoint.sh

Browse files
Files changed (1) hide show
  1. hf-entrypoint.sh +15 -0
hf-entrypoint.sh CHANGED
@@ -68,9 +68,24 @@ if [ "$#" -gt 0 ]; then
68
  exec "$@"
69
  fi
70
 
 
71
  if [ -n "${SUB2API_CMD:-}" ]; then
72
  exec bash -lc "${SUB2API_CMD}"
73
  fi
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  echo "[error] No CMD found. Please set Space variable SUB2API_CMD"
76
  exit 1
 
68
  exec "$@"
69
  fi
70
 
71
+ # 优先手动指定
72
  if [ -n "${SUB2API_CMD:-}" ]; then
73
  exec bash -lc "${SUB2API_CMD}"
74
  fi
75
 
76
+ # 自动回退:按常见入口顺序尝试
77
+ if [ -x /docker-entrypoint.sh ]; then
78
+ exec /docker-entrypoint.sh
79
+ elif [ -x /entrypoint.sh ]; then
80
+ exec /entrypoint.sh
81
+ elif command -v sub2api >/dev/null 2>&1; then
82
+ exec sub2api
83
+ elif [ -x /app/sub2api ]; then
84
+ exec /app/sub2api
85
+ fi
86
+
87
+ echo "[error] cannot find original sub2api entrypoint"
88
+ exit 1
89
+
90
  echo "[error] No CMD found. Please set Space variable SUB2API_CMD"
91
  exit 1