rustdesk/DEBIAN/preinst
fufesou 05b264c968 linux_wayland_support: build linux
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2022-07-20 09:16:13 -07:00

24 lines
549 B
Bash
Executable File

#!/bin/bash
set -e
case $1 in
install|upgrade)
INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')
if [ "systemd" == "${INITSYS}" ]; then
service rustdesk stop || true
serverUser=$(ps -ef | grep -E 'rustdesk +--server' | awk '{print $1}' | head -1)
if [ "$serverUser" != "" ] && [ "$serverUser" != "root" ]
then
systemctl --machine=${serverUser}@.host --user stop rustdesk || true
fi
sleep 1
rm -rf /usr/bin/libsciter-gtk.so
fi
;;
esac
exit 0