mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
* fix: incorrect linux install path * fix: synchronously modify the Linux postinst/uninst script
28 lines
1.1 KiB
Bash
28 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if type update-alternatives >/dev/null 2>&1; then
|
|
# Remove previous link if it doesn't use update-alternatives
|
|
if [ -L '/usr/bin/clash-party' ] && [ -e '/usr/bin/clash-party' ] && [ "$(readlink '/usr/bin/clash-party')" != '/etc/alternatives/clash-party' ]; then
|
|
rm -f '/usr/bin/clash-party'
|
|
fi
|
|
update-alternatives --install '/usr/bin/clash-party' 'clash-party' '/opt/clash-party/mihomo-party' 100 || ln -sf '/opt/clash-party/mihomo-party' '/usr/bin/clash-party'
|
|
else
|
|
ln -sf '/opt/clash-party/mihomo-party' '/usr/bin/clash-party'
|
|
fi
|
|
|
|
chmod 4755 '/opt/clash-party/chrome-sandbox' 2>/dev/null || true
|
|
|
|
chmod +sx /opt/clash-party/resources/sidecar/mihomo 2>/dev/null || true
|
|
chmod +sx /opt/clash-party/resources/sidecar/mihomo-alpha 2>/dev/null || true
|
|
chmod +sx /opt/clash-party/resources/sidecar/mihomo-smart 2>/dev/null || true
|
|
|
|
if hash update-mime-database 2>/dev/null; then
|
|
update-mime-database /usr/share/mime || true
|
|
fi
|
|
|
|
if hash update-desktop-database 2>/dev/null; then
|
|
update-desktop-database /usr/share/applications || true
|
|
fi
|