diff options
| author | Mikhail Grigorev <sleuthhound@gmail.com> | 2026-01-03 05:37:48 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-03 05:37:48 +0300 |
| commit | 3287fa4d80672f9f5fcf90e6059a190939445297 (patch) | |
| tree | 0f55caef9541032253c71aeea7c7c36285c11799 /update.sh | |
| parent | 1393f981bc313118b3ffde0b469cc07abdeb24c8 (diff) | |
Added EnvironmentFile to systemd unit (#3606)
* Added EnvironmentFile to systemd unit
* Added support for older releases
* Remove ARGS
* Fixed copy unit
* Fixed unit filename
* Update update.sh
Diffstat (limited to 'update.sh')
| -rwxr-xr-x | update.sh | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -615,6 +615,8 @@ update_x-ui() { echo -e "${green}Removing old x-ui version...${plain}" rm /usr/bin/x-ui -f >/dev/null 2>&1 rm /usr/local/x-ui/x-ui.service -f >/dev/null 2>&1 + rm /usr/local/x-ui/x-ui.service.debian -f >/dev/null 2>&1 + rm /usr/local/x-ui/x-ui.service.rhel -f >/dev/null 2>&1 rm /usr/local/x-ui/x-ui -f >/dev/null 2>&1 rm /usr/local/x-ui/x-ui.sh -f >/dev/null 2>&1 echo -e "${green}Removing old xray version...${plain}" @@ -677,8 +679,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}" - cp -f x-ui.service /etc/systemd/system/ >/dev/null 2>&1 + 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/x-ui.service >/dev/null 2>&1 + ;; + *) + echo -e "${green}Installing rhel-like systemd unit...${plain}" + cp -f x-ui.service.rhel /etc/systemd/system/x-ui.service >/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 |
