lotus/scripts/deploy-node.sh

39 lines
665 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
HOST=$1
# upload binaries
# TODO: destroy
FILES_TO_SEND=(
2020-04-23 08:48:31 +00:00
./lotus
2020-07-08 10:38:59 +00:00
./lotus-miner
scripts/lotus-daemon.service
scripts/louts-miner.service
)
rsync -P "${FILES_TO_SEND[@]}" "$HOST:~/lotus-stage/"
ssh "$HOST" 'bash -s' << 'EOF'
set -euo pipefail
2020-07-08 10:38:59 +00:00
systemctl stop lotus-miner
systemctl stop lotus-daemon
2020-07-08 10:53:04 +00:00
mkdir -p .lotus .lotusminer
cd "$HOME/lotus-stage/"
2020-07-08 10:38:59 +00:00
cp -f lotus lotus-miner /usr/local/bin
cp -f lotus-daemon.service /etc/systemd/system/lotus-daemon.service
2020-07-08 10:38:59 +00:00
cp -f lotus-miner.service /etc/systemd/system/lotus-miner.service
systemctl daemon-reload
systemctl start lotus-daemon
EOF
# setup miner actor