From 7bfaa557124b789dabe5db7682e15f85f40ad8bc Mon Sep 17 00:00:00 2001 From: smail Date: Sat, 17 Oct 2026 00:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=EF=BC=9A=E5=B0=B1=E5=9C=B0=E5=AE=89=E8=A3=85=E6=97=B6?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=87=AA=E8=BA=AB=E6=96=87=E4=BB=B6install?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/install-systemd.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/deploy/install-systemd.sh b/deploy/install-systemd.sh index 4d5e95d0..13ac2441 100644 --- a/deploy/install-systemd.sh +++ b/deploy/install-systemd.sh @@ -191,9 +191,26 @@ if [ -S /run/smail/admin-control.sock ]; then chown --no-dereference smail:smail /run/smail/admin-control.sock fi install -d -o root -g root -m 0755 /run/systemd/ask-password -install -o root -g root -m 0755 "$backend_smail" "$runtime_dir/smail" -install -o root -g root -m 0700 "$backend_smail_admin" "$runtime_dir/smail-admin" -install -o root -g root -m 0700 "$backend_smail_config" "$runtime_dir/smail-config" +if [ "$backend_smail" != "$runtime_dir/smail" ]; then + install -o root -g root -m 0755 "$backend_smail" "$runtime_dir/smail" +else + chown root:root "$runtime_dir/smail" + chmod 0755 "$runtime_dir/smail" +fi + +if [ "$backend_smail_admin" != "$runtime_dir/smail-admin" ]; then + install -o root -g root -m 0700 "$backend_smail_admin" "$runtime_dir/smail-admin" +else + chown root:root "$runtime_dir/smail-admin" + chmod 0700 "$runtime_dir/smail-admin" +fi + +if [ "$backend_smail_config" != "$runtime_dir/smail-config" ]; then + install -o root -g root -m 0700 "$backend_smail_config" "$runtime_dir/smail-config" +else + chown root:root "$runtime_dir/smail-config" + chmod 0700 "$runtime_dir/smail-config" +fi sed -e "s|WorkingDirectory=/opt/smail|WorkingDirectory=$runtime_dir|g" \ -e "s|ExecStart=/opt/smail/smail|ExecStart=$runtime_dir/smail|g" \ -e "s|/opt/smail/config|$runtime_dir/config|g" \