Update install_reader.sh
Browse files- install_reader.sh +4 -11
install_reader.sh
CHANGED
|
@@ -39,15 +39,8 @@ unzip "$zip_file"
|
|
| 39 |
# +x权限
|
| 40 |
find . -type f -exec chmod +x {} +
|
| 41 |
|
| 42 |
-
# 处理解压目录结构
|
| 43 |
-
dir_name=$(unzip -Z -1 "$zip_file" | head -n1 | cut -d '/' -f1)
|
| 44 |
-
if [ -n "$dir_name" ]; then
|
| 45 |
-
echo "进入解压目录: $dir_name"
|
| 46 |
-
cd "$dir_name"
|
| 47 |
-
fi
|
| 48 |
-
|
| 49 |
# 数据恢复逻辑
|
| 50 |
-
DATA_DIR="
|
| 51 |
if [ ! -d "${DATA_DIR}" ] || [ -z "$(ls -A ${DATA_DIR})" ]; then
|
| 52 |
echo "数据目录不存在或为空,尝试从WebDAV恢复备份..."
|
| 53 |
if curl -u "${WEBDAV_USER}:${WEBDAV_PASS}" "${WEBDAV_URL}/latest-backup.tar.gz" -o /tmp/latest-backup.tar.gz; then
|
|
@@ -78,10 +71,10 @@ done
|
|
| 78 |
) &
|
| 79 |
|
| 80 |
# 执行启动脚本
|
| 81 |
-
if [ -f "./startup.sh" ]; then
|
| 82 |
echo "正在启动服务..."
|
| 83 |
-
chmod +x "./startup.sh"
|
| 84 |
-
./startup.sh -m single
|
| 85 |
echo "服务已启动!"
|
| 86 |
tail -f /app/logs/start.out
|
| 87 |
else
|
|
|
|
| 39 |
# +x权限
|
| 40 |
find . -type f -exec chmod +x {} +
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# 数据恢复逻辑
|
| 43 |
+
DATA_DIR="./storage"
|
| 44 |
if [ ! -d "${DATA_DIR}" ] || [ -z "$(ls -A ${DATA_DIR})" ]; then
|
| 45 |
echo "数据目录不存在或为空,尝试从WebDAV恢复备份..."
|
| 46 |
if curl -u "${WEBDAV_USER}:${WEBDAV_PASS}" "${WEBDAV_URL}/latest-backup.tar.gz" -o /tmp/latest-backup.tar.gz; then
|
|
|
|
| 71 |
) &
|
| 72 |
|
| 73 |
# 执行启动脚本
|
| 74 |
+
if [ -f "./bin/startup.sh" ]; then
|
| 75 |
echo "正在启动服务..."
|
| 76 |
+
chmod +x "./bin/startup.sh"
|
| 77 |
+
./bin/startup.sh -m single
|
| 78 |
echo "服务已启动!"
|
| 79 |
tail -f /app/logs/start.out
|
| 80 |
else
|