mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-02 18:59:24 +08:00
c48ed06d93
Signed-off-by: fufesou <shuanglongchen@yeah.net>
24 lines
756 B
Bash
Executable File
24 lines
756 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
|
|
ln -s /usr/lib/rustdesk/rustdesk /usr/bin/rustdesk
|
|
|
|
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//./}")
|
|
mkdir -p /usr/lib/systemd/system/
|
|
cp /usr/share/rustdesk/files/systemd/rustdesk.service /usr/lib/systemd/system/rustdesk.service
|
|
systemctl daemon-reload
|
|
systemctl enable rustdesk
|
|
systemctl start rustdesk
|
|
fi
|
|
fi
|