Few more fixes

This commit is contained in:
Ze'ev Schurmann 2024-02-14 15:38:13 +02:00
parent 98d97ebf8c
commit f6513f78e6
1 changed files with 20 additions and 8 deletions

View File

@ -2,7 +2,7 @@
#SETTINGS #SETTINGS
passlen=22 passlen=22
emailforle="putyouremailaddresshere@domain.com" emailforle=""
#FUNCTIONS #FUNCTIONS
function errorcheck { function errorcheck {
@ -92,6 +92,13 @@ function gathersettings {
echo "IP address is $ipaddress..." echo "IP address is $ipaddress..."
echo -n "What is the FQDN for the server? " echo -n "What is the FQDN for the server? "
read fqdn read fqdn
echo -n "Do you want to configure the system hostname the same as the FQDN? (y/n)"
read reply
if [[ $reply == "y" ]]; then
sethost=true
else
sethost=false
fi
echo -n "Must an SLL certificate be used? (y/n)" echo -n "Must an SLL certificate be used? (y/n)"
read reply read reply
if [[ $reply == "y" ]]; then if [[ $reply == "y" ]]; then
@ -144,6 +151,9 @@ function gathersettings {
if [[ $mailfrom == "" ]]; then if [[ $mailfrom == "" ]]; then
mailfrom=$mailuser mailfrom=$mailuser
fi fi
if [[ $emailforle == "" ]]; then
emailforle=$mailfrom
fi
echo -n "What is the sender name for the mailserver? " echo -n "What is the sender name for the mailserver? "
read mailname read mailname
echo echo
@ -218,6 +228,7 @@ function applysettings {
function sethostname { function sethostname {
#SETTING UP HOSTNAME #SETTING UP HOSTNAME
if [[ $sethost == true ]]; then
echo "Setting up hostname..." echo "Setting up hostname..."
hostnamectl set-hostname ${fqdn%%.*} > /dev/null 2>&1 hostnamectl set-hostname ${fqdn%%.*} > /dev/null 2>&1
errorcheck $? "define hostname" "EXIT" errorcheck $? "define hostname" "EXIT"
@ -225,6 +236,7 @@ function sethostname {
errorcheck $? "define FQDN" "EXIT" errorcheck $? "define FQDN" "EXIT"
echo "1" > "$origpath/setupninja.step" echo "1" > "$origpath/setupninja.step"
echo echo
fi
} }
function initsetup { function initsetup {