[PR #6075] [MERGED] fix (install.sh): use realpath instead of script name #6071

Closed
opened 2026-11-02 04:06:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6075
Author: @Intervence
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @MHSanaei

Base: main ← Head: patch-1


📝 Commits (2)

  • cd0cb21 fix (install.sh): use realpath instead of script name
  • 1cff3dc fix(install): quote the script path before the self-delete

📊 Changes

1 file changed (+1 additions, -3 deletions)

View changed files

📝 install.sh (+1 -3)

📄 Description

Summary

  • arch(): changes hardcoded script relative path to basename
  • removes unused cur_dir variable

Why

During arch() sctipt tries to delete itself in case no compatible arch found. This may lead to unexpected file deletion if executed outside root dir; also cur_dir is declared but doesn't seem to be used anywhere

Type of change

  • [+] Bug fix

Areas affected

  • [+] Install / upgrade script

How was this tested?

First, i commented out x64 (my current arch) line to emulate unsupported arch and invoked script from different dir containing other install.sh

~/misc_tests$ cd ~/misc_tests
~/misc_tests$ ls install.sh
install.sh

./3x-ui/install.sh
The OS release is: ubuntu
Arch: Unsupported CPU architecture!
~/misc_tests$ ls install.sh
ls: cannot access 'install.sh': No such file or directory
~/misc_tests$ ls ./3x-ui/install.sh
./3x-ui/install.sh

Instead of deleting initial install script, corresponding script from current dir was deleted

Breaking changes

None

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6075 **Author:** [@Intervence](https://github.com/Intervence) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (2) - [`cd0cb21`](https://github.com/MHSanaei/3x-ui/commit/cd0cb2199bd15da42753de49efdbc4e8d5ee8e85) fix (install.sh): use realpath instead of script name - [`1cff3dc`](https://github.com/MHSanaei/3x-ui/commit/1cff3dcc12411d80768bd4d86ddc78693d825954) fix(install): quote the script path before the self-delete ### 📊 Changes **1 file changed** (+1 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `install.sh` (+1 -3) </details> ### 📄 Description ## Summary * arch(): changes hardcoded script relative path to basename * removes unused cur_dir variable ## Why During arch() sctipt tries to delete itself in case no compatible arch found. This may lead to unexpected file deletion if executed outside root dir; also cur_dir is declared but doesn't seem to be used anywhere ## Type of change - [+] Bug fix ## Areas affected - [+] Install / upgrade script ## How was this tested? First, i commented out x64 (my current arch) line to emulate unsupported arch and invoked script from different dir containing other install.sh ```bash ~/misc_tests$ cd ~/misc_tests ~/misc_tests$ ls install.sh install.sh ./3x-ui/install.sh The OS release is: ubuntu Arch: Unsupported CPU architecture! ~/misc_tests$ ls install.sh ls: cannot access 'install.sh': No such file or directory ~/misc_tests$ ls ./3x-ui/install.sh ./3x-ui/install.sh ``` Instead of deleting initial install script, corresponding script from current dir was deleted ## Breaking changes None ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior (when applicable). - [ ] `go build ./...` and the test suite pass locally. - [ ] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:10 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6071
No description provided.