#!/bin/bash
LINES=25
while getopts ":n:" opt; do
  case $opt in
    n) LINES="$OPTARG"
    ;;
    \?) echo "Unrecognized option -$OPTARG. Usage: node-red-log [-n lines]. For example: node-red-log -n 50" >&2 && exit 1
    ;;
  esac
done
echo -e '\033]2;'Node-RED log'\007'
echo " "
sudo journalctl -f -n $LINES -u nodered -o cat