mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-25 13:19:04 +08:00
05b264c968
Signed-off-by: fufesou <shuanglongchen@yeah.net>
24 lines
648 B
Bash
Executable File
24 lines
648 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
case $1 in
|
|
remove|upgrade)
|
|
INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')
|
|
if [ "systemd" == "${INITSYS}" ]; then
|
|
systemctl stop rustdesk || true
|
|
systemctl disable rustdesk || 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
|
|
|
|
rm /etc/systemd/system/rustdesk.service /usr/lib/systemd/system/rustdesk.service /usr/lib/systemd/user/rustdesk.service || true
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
exit 0
|