Advertisement
smeech

TTY two pi-hole status

Jun 8th, 2024 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3. # Uses Tnux to display gravity entries and Chronometer for two PiHholes
  4. # Most useful in a full-screen TTY console, e.g. <Ctrl-Alt-F2>
  5.  
  6. # Requires tmux and access to two Pi via ssh keys
  7. # chmod +x yourfilename to make executable
  8.  
  9. SESSION=$USER
  10.  
  11. tmux new-session -d -s $SESSION
  12.  
  13. # Setup a window for monitoring pi & dietpi
  14. tmux new-window -t $SESSION -n 'Pi'
  15.  
  16. # Split window into 4 panes
  17. tmux split-window -v
  18. tmux resize-pane -D 10
  19. tmux split-window -h
  20. tmux select-pane -t 0
  21. tmux split-window -h
  22.  
  23. tmux send-keys -t {top-left} "ssh stephen@10.0.0.7" C-m "pihole -t | grep -B 1 gravity" C-m
  24. tmux send-keys -t {bottom-left} "ssh stephen@10.0.0.7" C-m "pihole -c" C-m
  25. tmux send-keys -t {top-right} "ssh stephen@10.0.0.8" C-m "pihole -t | grep -B 1 gravity" C-m
  26. tmux send-keys -t {bottom-right} "ssh stephen@10.0.0.8" C-m "pihole -c" C-m
  27.  
  28. tmux select-window -t $SESSION:1
  29.  
  30. # Attach to session - works best in a TTY console
  31. tmux a -t $SESSION # or $USER
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement