mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-01-13 09:12:44 +00:00
Added support for older releases
This commit is contained in:
parent
f5eab61903
commit
420b4e49c9
2 changed files with 27 additions and 17 deletions
20
install.sh
20
install.sh
|
|
@ -230,14 +230,18 @@ install_x-ui() {
|
|||
rc-update add x-ui
|
||||
rc-service x-ui start
|
||||
else
|
||||
case "${release}" in
|
||||
ubuntu | debian | armbian)
|
||||
cp -f x-ui.service.debian /etc/systemd/system/
|
||||
;;
|
||||
*)
|
||||
cp -f x-ui.service.rhel /etc/systemd/system/
|
||||
;;
|
||||
esac
|
||||
if [ -f "x-ui.service" ]; then
|
||||
cp -f x-ui.service /etc/systemd/system/
|
||||
else
|
||||
case "${release}" in
|
||||
ubuntu | debian | armbian)
|
||||
cp -f x-ui.service.debian /etc/systemd/system/
|
||||
;;
|
||||
*)
|
||||
cp -f x-ui.service.rhel /etc/systemd/system/
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
systemctl daemon-reload
|
||||
systemctl enable x-ui
|
||||
systemctl start x-ui
|
||||
|
|
|
|||
24
update.sh
24
update.sh
|
|
@ -227,15 +227,21 @@ update_x-ui() {
|
|||
rc-update add x-ui >/dev/null 2>&1
|
||||
rc-service x-ui start >/dev/null 2>&1
|
||||
else
|
||||
echo -e "${green}Installing systemd unit...${plain}"
|
||||
case "${release}" in
|
||||
ubuntu | debian | armbian)
|
||||
cp -f x-ui.service.debian /etc/systemd/system/ >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
cp -f x-ui.service.rhel /etc/systemd/system/ >/dev/null 2>&1
|
||||
;;
|
||||
esac
|
||||
if [ -f "x-ui.service" ]; then
|
||||
echo -e "${green}Installing systemd unit...${plain}"
|
||||
cp -f x-ui.service /etc/systemd/system/ >/dev/null 2>&1
|
||||
else
|
||||
case "${release}" in
|
||||
ubuntu | debian | armbian)
|
||||
echo -e "${green}Installing debian-like systemd unit...${plain}"
|
||||
cp -f x-ui.service.debian /etc/systemd/system/ >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
echo -e "${green}Installing rhel-like systemd unit...${plain}"
|
||||
cp -f x-ui.service.rhel /etc/systemd/system/ >/dev/null 2>&1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
chown root:root /etc/systemd/system/x-ui.service >/dev/null 2>&1
|
||||
systemctl daemon-reload >/dev/null 2>&1
|
||||
systemctl enable x-ui >/dev/null 2>&1
|
||||
|
|
|
|||
Loading…
Reference in a new issue