2019-10-15 02:11:11 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-17 01:10:12 +00:00
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
|
|
|
|
|
2019-10-15 02:11:11 +00:00
|
|
|
HOST=$1
|
|
|
|
|
|
|
|
# upload binaries
|
|
|
|
# TODO: destroy
|
|
|
|
|
2019-10-17 01:10:12 +00:00
|
|
|
FILES_TO_SEND=(
|
|
|
|
./louts
|
|
|
|
./lotus-storage-miner
|
|
|
|
scripts/lotus-daemon.service
|
|
|
|
scripts/louts-miner.service
|
|
|
|
)
|
|
|
|
|
2019-10-17 04:24:32 +00:00
|
|
|
rsync -P "${FILES_TO_SEND[@]}" "$HOST:~/lotus-stage/"
|
2019-10-17 01:10:12 +00:00
|
|
|
|
2019-10-17 04:24:32 +00:00
|
|
|
ssh "$HOST" 'bash -s' << 'EOF'
|
2019-10-17 01:10:12 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
systemctl stop lotus-storage-miner
|
|
|
|
systemctl stop lotus-daemon
|
|
|
|
mkdir -p .lotus .lotusstorage
|
2019-10-15 02:11:11 +00:00
|
|
|
|
2019-10-17 01:10:12 +00:00
|
|
|
cd "$HOME/lotus-stage/"
|
|
|
|
cp -f louts lotus-storage-miner /usr/local/bin
|
|
|
|
cp -f lotus-daemon.service /etc/systemd/system/lotus-daemon.service
|
|
|
|
cp -f lotus-miner.service /etc/systemd/system/lotus-storage-miner.service
|
2019-10-15 02:11:11 +00:00
|
|
|
|
2019-10-17 01:10:12 +00:00
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl start lotus-daemon
|
|
|
|
EOF
|
2019-10-15 02:11:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
# setup miner actor
|