menu-dojo-error-logs.sh
1 #!/bin/bash 2 3 # shellcheck source=./Scripts/defaults.sh 4 . "$HOME"/RoninDojo/Scripts/defaults.sh 5 6 # shellcheck source=./Scripts/functions.sh 7 . "$HOME"/RoninDojo/Scripts/functions.sh 8 9 OPTIONS=(1 "Bitcoind" 10 2 "MariaDB" 11 3 "Indexer" 12 4 "Node.js" 13 5 "Tor" 14 6 "Go Back") 15 16 CHOICE=$(dialog --clear \ 17 --title "$TITLE" \ 18 --menu "$MENU" \ 19 "$HEIGHT" "$WIDTH" "$CHOICE_HEIGHT" \ 20 "${OPTIONS[@]}" \ 21 2>&1 >/dev/tty) 22 23 clear 24 case $CHOICE in 25 1|2|3|4|5) 26 if ! _is_dojo_running; then 27 _print_message "Please start Dojo first!" 28 _sleep 5 29 bash -c "${ronin_dojo_error_logs_menu}" 30 exit 31 fi 32 cd "$dojo_path_my_dojo" || exit 33 _print_message "Press Ctrl + C to exit at any time..." 34 _sleep 35 ;; 36 esac 37 case $CHOICE in 38 1) 39 ./dojo.sh logs bitcoind -n 200 | grep -i 'error' 40 ;; 41 2) 42 ./dojo.sh logs db -n 500 | grep -i 'error' 43 ;; 44 3) 45 _fetch_configured_indexer_type 46 indexer=$? 47 48 if ((indexer==3)); then 49 _print_message "No indexer installed..." 50 _sleep 51 _print_message "Install using the applications install menu..." 52 _sleep 53 54 elif ((indexer==2)); then 55 _print_message "Fulcrum Server is your current Indexer..." 56 _sleep 57 58 ./dojo.sh logs fulcrum -n 500 | grep -i 'error' 59 60 elif ((indexer==1)); then 61 _print_message "SW Addrindexrs is your current Indexer..." 62 _sleep 63 64 ./dojo.sh logs indexer -n 500 | grep -i 'error' 65 66 elif ((indexer==0)); then 67 _print_message "Electrs is your current Indexer..." 68 _sleep 69 70 ./dojo.sh logs electrs -n 500 | grep -i 'error' 71 72 else 73 _print_message "Something went wrong! Contact support..." 74 _sleep 75 fi 76 ;; 77 4) 78 ./dojo.sh logs node -n 500 | grep -i 'error' 79 ;; 80 5) 81 ./dojo.sh logs tor -n 500 | grep -i 'error' 82 ;; 83 6) 84 bash "${ronin_dojo_logs_menu}" 85 exit 86 ;; 87 esac 88 89 _pause return 90 bash -c "${ronin_dojo_error_logs_menu}" 91 exit