mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-25 21:49:04 +08:00
05b264c968
Signed-off-by: fufesou <shuanglongchen@yeah.net>
28 lines
946 B
Bash
Executable File
28 lines
946 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if [ "$1" = configure ]; then
|
|
|
|
INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')
|
|
|
|
if [ "systemd" == "$INITSYS" ]; then
|
|
if [ -e /etc/systemd/system/rustdesk.service ]; then
|
|
rm /etc/systemd/system/rustdesk.service /usr/lib/systemd/system/rustdesk.service /usr/lib/systemd/user/rustdesk.service >/dev/null 2>&1
|
|
fi
|
|
version=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)')
|
|
parsedVersion=$(echo "${version//./}")
|
|
if [[ "$parsedVersion" -gt "360" ]]; then
|
|
sudo -H pip3 install pynput
|
|
fi
|
|
cp /usr/share/rustdesk/files/systemd/rustdesk.service /usr/lib/systemd/system/rustdesk.service
|
|
systemctl daemon-reload
|
|
systemctl enable rustdesk
|
|
systemctl start rustdesk
|
|
|
|
cp /usr/share/rustdesk/files/systemd/rustdesk.service.user /usr/lib/systemd/user/rustdesk.service
|
|
curUser=$(who | awk '{print $1}' | head -1)
|
|
systemctl --machine=${curUser}@.host --user daemon-reload
|
|
fi
|
|
fi
|