Monday, August 3, 2020

Raspberry Pi Console server

I’m only using the four usb ports, but I had to make the constant. Otherwise the devices changed…

root@consoleserver1:~# cat console.sh
#!/bin/bash
  CMD='/usr/bin/minicom -D'
  echo "==================================================="
  echo "0 - /dev/ttyUSB_OS = Openvpn Server"
  echo "1 - /dev/ttyUSB_N1 = N1 (NAS1 Server) (Movies)"
  echo "2 - /dev/ttyUSB_N2 = N2 (NAS2 Server) (Homes)"
  echo "3 - /dev/ttyUSB_NSAVAN = NASVAN - DDWRT RTR"
  echo "=================================================="
  echo

  echo Enter your Console:
  read con
  if [[ $con == 0 ]] ; then
      TTY='/dev/ttyUSB_OS'
      $CMD $TTY
  fi
  if [[ $con == 1 ]] ; then
      TTY='/dev/ttyUSB_N1'
      $CMD $TTY
  fi
  if [[ $con == 2 ]] ; then
      TTY='/dev/ttyUSB_N2'
      $CMD $TTY
  fi
  if [[ $con == 3 ]] ; then
      TTY='/dev/ttyUSB_NSAVAN'
      $CMD $TTY
  fi
  root@consoleserver1:~#

That lets me hit four of my devices in the attic… I really need a 20 port usb hub :)