Add hostname & domain query
This commit is contained in:
parent
6844726dbd
commit
2258760eba
1 changed files with 11 additions and 2 deletions
|
@ -156,6 +156,7 @@ function introDialogue() {
|
||||||
|
|
||||||
OS: NoveriaOS
|
OS: NoveriaOS
|
||||||
Version: $(date "+%Y%m")
|
Version: $(date "+%Y%m")
|
||||||
|
IP: $(ifconfig eth0 | grep "inet addr" | awk '{$1=$1};1' | awk '{print $2}' | cut -d: -f2)
|
||||||
|
|
||||||
How do you want to continue?
|
How do you want to continue?
|
||||||
"
|
"
|
||||||
|
@ -215,6 +216,13 @@ function prepareInstallation() {
|
||||||
INSTALLATION_ROOT_PW="${INSTALLATION_ROOT_PW}-$(randomPasswordGen 5)"
|
INSTALLATION_ROOT_PW="${INSTALLATION_ROOT_PW}-$(randomPasswordGen 5)"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# hostname
|
||||||
|
INSTALLATION_HOSTNAME=$(dialog --clear --title "What's the hostname of this device?" --inputbox "Enter hostname" 10 70 3>&1 1>&2 2>&3 3>&-)
|
||||||
|
|
||||||
|
# domain
|
||||||
|
INSTALLATION_DOMAIN=$(dialog --clear --title "What's the domain of this device?" --inputbox "Enter domain (leave empty for localhost)" 10 70 3>&1 1>&2 2>&3 3>&-)
|
||||||
|
[[ -z "$INSTALLATION_DOMAIN" ]] && INSTALLATION_DOMAIN="localhost"
|
||||||
|
|
||||||
# show summary
|
# show summary
|
||||||
summary
|
summary
|
||||||
}
|
}
|
||||||
|
@ -224,6 +232,7 @@ function prepareInstallation() {
|
||||||
##
|
##
|
||||||
function summary() {
|
function summary() {
|
||||||
dialog --stdout --clear --title "Summary" --yes-label "Confirm" --no-label "Abort" --yesno "\n
|
dialog --stdout --clear --title "Summary" --yes-label "Confirm" --no-label "Abort" --yesno "\n
|
||||||
|
Hostname: ${INSTALLATION_HOSTNAME}.${INSTALLATION_DOMAIN}\n
|
||||||
Disk: $INSTALLATION_DISK
|
Disk: $INSTALLATION_DISK
|
||||||
" 9 60
|
" 9 60
|
||||||
|
|
||||||
|
@ -357,7 +366,7 @@ function installation() {
|
||||||
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "hwclock --systohc" || installationFailed
|
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "hwclock --systohc" || installationFailed
|
||||||
|
|
||||||
installationSubtaskTitle "Setup hostname"
|
installationSubtaskTitle "Setup hostname"
|
||||||
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "echo 'nov-alp1.localhost' > /etc/hostname" || installationFailed
|
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "echo '${INSTALLATION_HOSTNAME}.${INSTALLATION_DOMAIN}' > /etc/hostname" || installationFailed
|
||||||
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "hostname -F /etc/hostname" || installationFailed
|
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "hostname -F /etc/hostname" || installationFailed
|
||||||
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "rc-update add hostname" || installationFailed
|
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "rc-update add hostname" || installationFailed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue