#!/bin/bash

default_interface=$(route -n | awk '$1 == "0.0.0.0" {print $8; exit}')
ip_address=$(ifconfig "$default_interface" | awk 'sub(/.* inet addr:/, "") {print $1}')
sed -i "13s/.*/SURICATA_INTERFACE=$default_interface/" /etc/siemonster/common.env

cat <<EOF > /etc/issue
Welcome to SIEMonster Hydra \n \l
${default_interface}: \4${ip_address}
EOF
