mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-01-15 10:09:34 +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
|
|
@ -229,6 +229,9 @@ install_x-ui() {
|
||||||
chmod +x /etc/init.d/x-ui
|
chmod +x /etc/init.d/x-ui
|
||||||
rc-update add x-ui
|
rc-update add x-ui
|
||||||
rc-service x-ui start
|
rc-service x-ui start
|
||||||
|
else
|
||||||
|
if [ -f "x-ui.service" ]; then
|
||||||
|
cp -f x-ui.service /etc/systemd/system/
|
||||||
else
|
else
|
||||||
case "${release}" in
|
case "${release}" in
|
||||||
ubuntu | debian | armbian)
|
ubuntu | debian | armbian)
|
||||||
|
|
@ -238,6 +241,7 @@ install_x-ui() {
|
||||||
cp -f x-ui.service.rhel /etc/systemd/system/
|
cp -f x-ui.service.rhel /etc/systemd/system/
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable x-ui
|
systemctl enable x-ui
|
||||||
systemctl start x-ui
|
systemctl start x-ui
|
||||||
|
|
|
||||||
|
|
@ -227,15 +227,21 @@ update_x-ui() {
|
||||||
rc-update add x-ui >/dev/null 2>&1
|
rc-update add x-ui >/dev/null 2>&1
|
||||||
rc-service x-ui start >/dev/null 2>&1
|
rc-service x-ui start >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
|
if [ -f "x-ui.service" ]; then
|
||||||
echo -e "${green}Installing systemd unit...${plain}"
|
echo -e "${green}Installing systemd unit...${plain}"
|
||||||
|
cp -f x-ui.service /etc/systemd/system/ >/dev/null 2>&1
|
||||||
|
else
|
||||||
case "${release}" in
|
case "${release}" in
|
||||||
ubuntu | debian | armbian)
|
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
|
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
|
cp -f x-ui.service.rhel /etc/systemd/system/ >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
chown root:root /etc/systemd/system/x-ui.service >/dev/null 2>&1
|
chown root:root /etc/systemd/system/x-ui.service >/dev/null 2>&1
|
||||||
systemctl daemon-reload >/dev/null 2>&1
|
systemctl daemon-reload >/dev/null 2>&1
|
||||||
systemctl enable x-ui >/dev/null 2>&1
|
systemctl enable x-ui >/dev/null 2>&1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue