x-ui: improve [Logs Management]

if exit on Debug Log with ctrl+c auto back to main menu

install: recheck webBasePath on config_after_install

Co-authored-by: mhsanaei <ho3ein.sanaei@gmail.com>
Signed-off-by: Salman Wahib <sxlmnwb.dev@gmail.com>
This commit is contained in:
sxlmnwb 2024-10-18 10:22:29 +07:00
parent 64a1456b29
commit 1a6e28505a
No known key found for this signature in database
GPG key ID: E1A570AF1FB71951
2 changed files with 5 additions and 4 deletions

View file

@ -143,7 +143,7 @@ config_after_install() {
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
# Check if username and password exist
if [[ -n "$existing_username" && -n "$existing_password" ]]; then
if [[ -n "$existing_username" && -n "$existing_password" && -n "$existing_webBasePath" ]]; then
# If webBasePath is missing, generate a new one
if [[ ${#existing_webBasePath} -lt 4 ]]; then
local config_webBasePath=$(gen_random_string 15)

View file

@ -467,13 +467,14 @@ show_log() {
case "$choice" in
0)
return
show_menu
;;
1)
# Set trap to catch Ctrl+C and return to the menu
trap 'before_show_menu' SIGINT
journalctl -u x-ui -e --no-pager -f -p debug
if [[ $# == 0 ]]; then
# After exiting journalctl, return to the menu
before_show_menu
fi
;;
2)
sudo journalctl --rotate