From dec3cde9b32dd3fa5166bc8b0dd228f7249a260a Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:56:21 +0800 Subject: [PATCH] fix: deb, build, prerm (#9552) Signed-off-by: fufesou --- res/DEBIAN/prerm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/res/DEBIAN/prerm b/res/DEBIAN/prerm index 938424a8b..baef2e2e2 100755 --- a/res/DEBIAN/prerm +++ b/res/DEBIAN/prerm @@ -14,15 +14,10 @@ case $1 in rm /etc/systemd/system/rustdesk.service /usr/lib/systemd/system/rustdesk.service || true # workaround temp dev build between 1.1.9 and 1.2.0 - ubuntuVersion=$(grep -oP 'VERSION_ID="\K[\d]+' /etc/os-release | awk '{print $1}') - waylandSupportVersion=21 - if [ "$ubuntuVersion" != "" ] && [ "$ubuntuVersion" -ge "$waylandSupportVersion" ] + serverUser=$(ps -ef | grep -E 'rustdesk +--server' | grep -v 'sudo ' | awk '{print $1}' | head -1) + if [ "$serverUser" != "" ] && [ "$serverUser" != "root" ] then - serverUser=$(ps -ef | grep -E 'rustdesk +--server' | grep -v 'sudo ' | awk '{print $1}' | head -1) - if [ "$serverUser" != "" ] && [ "$serverUser" != "root" ] - then - systemctl --machine=${serverUser}@.host --user stop rustdesk >/dev/null 2>&1 || true - fi + systemctl --machine=${serverUser}@.host --user stop rustdesk >/dev/null 2>&1 || true fi rm /usr/lib/systemd/user/rustdesk.service >/dev/null 2>&1 || true fi