From be871d033a362eddd75d3875b809e62ee34d27bd Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Tue, 5 Jan 2021 14:11:46 -0500 Subject: [PATCH] new instll --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 740779ce..42fbaf4c 100644 --- a/Makefile +++ b/Makefile @@ -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