fix: deb, build, prerm (#9552)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-10-03 17:56:21 +08:00 committed by GitHub
parent c4d0b02478
commit dec3cde9b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,16 +14,11 @@ 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" ]
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
fi
rm /usr/lib/systemd/user/rustdesk.service >/dev/null 2>&1 || true
fi
;;