Skip to content
Permalink
Browse files

Hostname corrections for AWS

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 23, 2019
1 parent 1e51043 commit 8efa2160c8ed61ec062c28fbf3dcf9984c6e6b8d
Showing with 9 additions and 2 deletions.
  1. +2 −2 build/170-cockpit
  2. +7 −0 build/200-hostname
@@ -11,8 +11,8 @@ echo $0 > /var/www/html/userfiles/nems-build.cur
apt update
apt -y install cockpit

# Install cockpit-networkmanager on all but Docker
# Install cockpit-networkmanager on all but Docker and AWS
platform=$(/usr/local/share/nems/nems-scripts/info.sh platform)
if (( $platform != 21 )); then
if (( $platform != 21 )) && (( $platform != 22 )); then
apt -y install cockpit-networkmanager
fi
@@ -5,6 +5,13 @@ hn=$(/bin/hostname)
printf "Changing Hostname... "
/bin/sed -i -- 's/'"$hn"'/nems/g' /etc/hosts
/bin/sed -i -- 's/'"$hn"'/nems/g' /etc/hostname

platform=$(/usr/local/share/nems/nems-scripts/info.sh platform)
if (( $platform == 22 )); then
/bin/sed -i -- 's/ {{hostname}}/ nems/g' /etc/cloud/templates/hosts.debian.tmpl
/bin/sed -i -- 's/127.0.0.1 localhost/127.0.0.1 localhost nems/g' /etc/cloud/templates/hosts.debian.tmpl
fi

hostnamectl set-hostname nems
echo Done.
echo Change will take effect at next reboot.

0 comments on commit 8efa216

Please sign in to comment.
You can’t perform that action at this time.