mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-13 19:49:12 +00:00
Fix for reading logs
This commit is contained in:
parent
a28fa2eddd
commit
e56b70ee5f
1 changed files with 47 additions and 25 deletions
72
x-ui.sh
72
x-ui.sh
|
@ -402,32 +402,54 @@ disable() {
|
|||
}
|
||||
|
||||
show_log() {
|
||||
echo -e "${green}\t1.${plain} Debug Log"
|
||||
echo -e "${green}\t2.${plain} Clear All logs"
|
||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||
read -rp "Choose an option: " choice
|
||||
if [[ $release == "alpine" ]]; then
|
||||
echo -e "${green}\t1.${plain} Debug Log"
|
||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||
read -rp "Choose an option: " choice
|
||||
|
||||
case "$choice" in
|
||||
0)
|
||||
show_menu
|
||||
;;
|
||||
1)
|
||||
journalctl -u x-ui -e --no-pager -f -p debug
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
sudo journalctl --rotate
|
||||
sudo journalctl --vacuum-time=1s
|
||||
echo "All Logs cleared."
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
||||
show_log
|
||||
;;
|
||||
esac
|
||||
case "$choice" in
|
||||
0)
|
||||
show_menu
|
||||
;;
|
||||
1)
|
||||
grep -F 'x-ui[' /var/log/messages
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
||||
show_log
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "${green}\t1.${plain} Debug Log"
|
||||
echo -e "${green}\t2.${plain} Clear All logs"
|
||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||
read -rp "Choose an option: " choice
|
||||
|
||||
case "$choice" in
|
||||
0)
|
||||
show_menu
|
||||
;;
|
||||
1)
|
||||
journalctl -u x-ui -e --no-pager -f -p debug
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
sudo journalctl --rotate
|
||||
sudo journalctl --vacuum-time=1s
|
||||
echo "All Logs cleared."
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
||||
show_log
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
bbr_menu() {
|
||||
|
|
Loading…
Reference in a new issue