From e6a114bef9efcd3884486b014dbe6dfb29b593f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Fri, 10 Jan 2025 09:28:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/install.sh b/bin/install.sh index 20fd4db..eb7d0d4 100644 --- a/bin/install.sh +++ b/bin/install.sh @@ -126,15 +126,16 @@ setup_service() { git clone $INK_SCREEN_CLOCK_REPO_URL if [ $? -eq 0 ]; then # 假设服务文件在仓库的 service 文件夹下 - SERVICE_FILE_PATH="$HOME/2.13-Ink-screen-clock/bin/raspi_e-paper.service" + SERVICE_PATH="raspi_e-paper.service" + SERVICE_FILE_PATH="$HOME/2.13-Ink-screen-clock/bin/$SERVICE_PATH" if [ -f "$SERVICE_FILE_PATH" ]; then # 复制服务文件到 systemd 目录 sudo cp "$SERVICE_FILE_PATH" /etc/systemd/system/ # 重载 systemd 管理器配置 sudo systemctl daemon-reload # 启动服务 - sudo systemctl enable ink-screen-clock.service - sudo systemctl start ink-screen-clock.service + sudo systemctl enable $SERVICE_PATH + sudo systemctl start $SERVICE_PATH else echo "服务文件不存在于路径: $SERVICE_FILE_PATH" exit 1