Fixed a couple typos in the initial-setup script

This commit is contained in:
Gregory Ballantine 2024-04-23 13:05:03 -04:00
parent 2a1d0b520f
commit 3b10d7ee0f

View File

@ -4,30 +4,15 @@ SALT_MASTER='salt-v1.int.metaunix.net'
# determine OS version
if [ -f '/etc/redhat-release' ]; then
OS="debian"
elif [ -f '/etc/debian-release' ]; then
OS="rhel"
elif [ -f '/etc/debian_version' ]; then
OS="debian"
elif [ -d '/etc/ubuntu-advantage' ]; then
OS="ubuntu"
else
OS="freebsd"
fi
read -p 'System hostname: ' HOSTNAME
read -p 'System domain: ' DOMAIN
if [ "$OS" = 'freebsd' ]; then
# Configure system hostname
sysrc hostname="$HOSTNAME.$DOMAIN"
# Configure salt
echo "$HOSTNAME" > /usr/local/etc/salt/minion_id
sed -i .orig "s/\#master: salt/master: $SALT_MASTER/" /usr/local/etc/salt/minion
rm -rf /usr/local/etc/salt/pki
# Enable and start salt
sysrc salt_minion_enable="YES"
service salt_minion start
else
# Configure system hostname
hostnamectl set-hostname "$HOSTNAME"