Skip to content

Commit

Permalink
More elegant solution to change the hostname and the entry in /etc/hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Dec 26, 2020
1 parent fef03f9 commit 5d221b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions setup/tx-pi-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ fi

if [ "$HOSTNAME" == "raspberrypi" ]; then
msg "Found default hostname, change it to 'tx-pi'"
sed -i "s/127.0.1.1.*${HOSTNAME}/127.0.1.1\ttx-pi/g" /etc/hosts
echo "tx-pi" > /etc/hostname
raspi-config nonint do_hostname tx-pi
rm -f /etc/ssh/ssh_host_*
ssh-keygen -A
fi
Expand Down

0 comments on commit 5d221b2

Please sign in to comment.