mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-11 12:46:19 +00:00
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:
parent
64a1456b29
commit
1a6e28505a
2 changed files with 5 additions and 4 deletions
|
@ -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}')
|
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
|
||||||
|
|
||||||
# Check if username and password exist
|
# 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 webBasePath is missing, generate a new one
|
||||||
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
||||||
local config_webBasePath=$(gen_random_string 15)
|
local config_webBasePath=$(gen_random_string 15)
|
||||||
|
|
7
x-ui.sh
7
x-ui.sh
|
@ -467,13 +467,14 @@ show_log() {
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
0)
|
0)
|
||||||
return
|
show_menu
|
||||||
;;
|
;;
|
||||||
1)
|
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
|
journalctl -u x-ui -e --no-pager -f -p debug
|
||||||
if [[ $# == 0 ]]; then
|
# After exiting journalctl, return to the menu
|
||||||
before_show_menu
|
before_show_menu
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
sudo journalctl --rotate
|
sudo journalctl --rotate
|
||||||
|
|
Loading…
Reference in a new issue