Skip to content

Commit

Permalink
new instll
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Jan 5, 2021
1 parent f304a65 commit be871d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,20 @@ install-leader: install-git install-python install-mqtt configure-mqtt-websocket
sudo apt-get install sshpass

configure-hostname:
read -p "Enter new Pioreactor name: " userEnteredPioName; \
sudo hostname $$userEnteredPioName
hostname | sudo tee /etc/hostname

wget https://github.com/cbednarski/hostess/releases/download/v0.5.2/hostess_linux_arm
chmod a+x hostess_linux_arm
sudo ./hostess_linux_arm rm raspberrypi
sudo ./hostess_linux_arm add "$${userEnteredPioName}" 127.0.1.1
sudo ./hostess_linux_arm add "$(hostname)" 127.0.1.1

install-leader-as-worker: configure-hostname install-leader install-worker
# I had trouble with variables, quotes and dollar signs, so https://stackoverflow.com/questions/10121182/multiline-bash-commands-in-makefile/29085684#29085684
{ \
set -e ;\
touch ~/.pioreactor/config_$$userEnteredPioName.ini ;\
touch ~/.pioreactor/config_"$(hostname)".ini ;\
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys ;\
}
sudo reboot

0 comments on commit be871d0

Please sign in to comment.