#!/bin/bash # ## WK HW diagnostics - Launcher MODE="$1" # Ensure a proper mode is selected while :; do if [[ "$MODE" =~ ^(all|cpu|drives|foh|smart|badblocks)$ ]]; then break else clear echo "Hardware Diagnostics" echo "────────────────────" echo "0: Quick drive test" echo "1: All tests" echo "2: Prime95" echo "3: SMART & badblocks" echo "4: SMART" echo "5: badblocks" echo "────────────────────" if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then echo "6: Graphics Test - FurMark" echo "7: Graphics Test - Piano" echo "8: Graphics Test - Volplosion" fi echo "A: Speaker Test" if [[ -n $DISPLAY ]]; then echo "K: Keyboard Test" fi echo "────────────────────" echo "" echo "Q: Quit" echo "" read -r -p "Please make a selection: " MODE # Check input case $MODE in 0) MODE=foh break;; 1) MODE=all break;; 2) MODE=cpu break;; 3) MODE=drives break;; 4) MODE=smart break;; 5) MODE=badblocks break;; 6) if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then gputest /fullscreen /test=fur fi ;; 7) if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then gputest /fullscreen /test=pixmark_piano fi ;; 8) if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then gputest /fullscreen /test=pixmark_volplosion fi ;; a|A|audio|Audio) hw-diags-audio;; k|K|keyboard|Keyboard) if [[ -n $DISPLAY ]]; then xev fi ;; q|Q|quit|Quit) exit 1;; esac fi done # Start tmux tmux new-session -s 'hw-session' -n 'hw-window' "hw-diags-inner $MODE"