Skip to content

Commit

Permalink
Better solution for changing the hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Dec 26, 2020
1 parent a280aed commit fef03f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup/tx-pi-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ else
header "Setup for Waveshare 3.2 inch screen"
fi

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

0 comments on commit fef03f9

Please sign in to comment.