From 8cb836a17a6fd02672e662b0550fa90ebc2ad7f8 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Fri, 15 Jan 2021 16:22:07 -0500 Subject: [PATCH] [fix] Don't preset HOSTNAME var, interferes with automation --- setup/so-functions | 3 --- setup/so-whiptail | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 83a3ec7fd..ec76398b9 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -501,9 +501,6 @@ collect_homenet_snsr() { } collect_hostname() { - HOSTNAME=$(cat /etc/hostname) - if [[ "$HOSTNAME" == *'localhost'* ]]; then HOSTNAME=securityonion; fi - whiptail_set_hostname while ! valid_hostname "$HOSTNAME"; do diff --git a/setup/so-whiptail b/setup/so-whiptail index 20627f13f..ec3fd9e3e 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -1273,6 +1273,9 @@ whiptail_set_hostname() { [ -n "$TESTING" ] && return + HOSTNAME=$(cat /etc/hostname) + if [[ "$HOSTNAME" == *'localhost'* ]]; then HOSTNAME=securityonion; fi + HOSTNAME=$(whiptail --title "Security Onion Setup" --inputbox \ "Enter the hostname (not FQDN) you would like to set:" 10 75 "$HOSTNAME" 3>&1 1>&2 2>&3)