2022-04-18 15:37:35 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ "$1" = configure ]; then
|
|
|
|
|
|
|
|
INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')
|
2023-11-23 21:56:36 +08:00
|
|
|
ln -s /usr/lib/rustdesk/rustdesk /usr/bin/rustdesk
|
2022-09-13 14:27:07 +08:00
|
|
|
|
2022-04-18 15:37:35 +08:00
|
|
|
if [ "systemd" == "$INITSYS" ]; then
|
2022-09-13 14:27:07 +08:00
|
|
|
|
2022-04-18 15:37:35 +08:00
|
|
|
if [ -e /etc/systemd/system/rustdesk.service ]; then
|
2022-07-07 01:27:21 +08:00
|
|
|
rm /etc/systemd/system/rustdesk.service /usr/lib/systemd/system/rustdesk.service /usr/lib/systemd/user/rustdesk.service >/dev/null 2>&1
|
2022-04-18 15:37:35 +08:00
|
|
|
fi
|
2022-05-14 11:46:20 +08:00
|
|
|
version=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)')
|
|
|
|
parsedVersion=$(echo "${version//./}")
|
2022-10-13 21:34:50 +08:00
|
|
|
mkdir -p /usr/lib/systemd/system/
|
2022-07-07 01:27:21 +08:00
|
|
|
cp /usr/share/rustdesk/files/systemd/rustdesk.service /usr/lib/systemd/system/rustdesk.service
|
2022-04-18 15:37:35 +08:00
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl enable rustdesk
|
|
|
|
systemctl start rustdesk
|
|
|
|
fi
|
|
|
|
fi
|