mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-14 03:59:13 +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() {
|
show_log() {
|
||||||
echo -e "${green}\t1.${plain} Debug Log"
|
if [[ $release == "alpine" ]]; then
|
||||||
echo -e "${green}\t2.${plain} Clear All logs"
|
echo -e "${green}\t1.${plain} Debug Log"
|
||||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||||
read -rp "Choose an option: " choice
|
read -rp "Choose an option: " choice
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
0)
|
0)
|
||||||
show_menu
|
show_menu
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
journalctl -u x-ui -e --no-pager -f -p debug
|
grep -F 'x-ui[' /var/log/messages
|
||||||
if [[ $# == 0 ]]; then
|
if [[ $# == 0 ]]; then
|
||||||
before_show_menu
|
before_show_menu
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
2)
|
*)
|
||||||
sudo journalctl --rotate
|
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
||||||
sudo journalctl --vacuum-time=1s
|
show_log
|
||||||
echo "All Logs cleared."
|
;;
|
||||||
restart
|
esac
|
||||||
;;
|
else
|
||||||
*)
|
echo -e "${green}\t1.${plain} Debug Log"
|
||||||
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
echo -e "${green}\t2.${plain} Clear All logs"
|
||||||
show_log
|
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||||
;;
|
read -rp "Choose an option: " choice
|
||||||
esac
|
|
||||||
|
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() {
|
bbr_menu() {
|
||||||
|
|
Loading…
Reference in a new issue