mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
fix SUID chrome-sandbox (#12)
Co-authored-by: 布丁狗~ <pompurin404@mihomo.party>
This commit is contained in:
parent
2d6e8f5fd0
commit
4724ab5b91
21
build/linux/deb/postinst
Normal file
21
build/linux/deb/postinst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if type update-alternatives 2>/dev/null >&1; then
|
||||||
|
# Remove previous link if it doesn't use update-alternatives
|
||||||
|
if [ -L '/usr/bin/mihomo-party' -a -e '/usr/bin/mihomo-party' -a "`readlink '/usr/bin/mihomo-party'`" != '/etc/alternatives/mihomo-party' ]; then
|
||||||
|
rm -f '/usr/bin/mihomo-party'
|
||||||
|
fi
|
||||||
|
update-alternatives --install '/usr/bin/mihomo-party' 'mihomo-party' '/opt/mihomo-party/mihomo-party' 100 || ln -sf '/opt/mihomo-party/mihomo-party' '/usr/bin/mihomo-party'
|
||||||
|
else
|
||||||
|
ln -sf '/opt/mihomo-party/mihomo-party' '/usr/bin/mihomo-party'
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod 4755 '/opt/mihomo-party/chrome-sandbox' || 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
|
||||||
@ -58,5 +58,7 @@ linux:
|
|||||||
maintainer: mihomo-party
|
maintainer: mihomo-party
|
||||||
category: Utility
|
category: Utility
|
||||||
artifactName: ${name}-linux-${version}-${arch}.${ext}
|
artifactName: ${name}-linux-${version}-${arch}.${ext}
|
||||||
|
deb:
|
||||||
|
afterInstall: "build/linux/deb/postinst"
|
||||||
npmRebuild: true
|
npmRebuild: true
|
||||||
publish: []
|
publish: []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user