Use host file to get MiSTer IP for build.sh

This commit is contained in:
sorgelig
2018-05-02 22:50:58 +08:00
parent a7d7960c0e
commit 231f730e62
2 changed files with 9 additions and 3 deletions

1
.gitignore vendored
View File

@@ -20,6 +20,7 @@
# ignore directories
Debug
host
*.lst
*.elf
*.map

View File

@@ -1,5 +1,10 @@
#!/bin/bash
# create simple text file named 'host' in this folder with IP address of your MiSTer.
HOST=192.168.1.75
[ -f host ] && HOST=$(cat host)
# make script fail if any command failed,
# so we don't need to check the exit status of every command.
set -e
@@ -7,14 +12,14 @@ set -o pipefail
make
set +e
plink root@192.168.1.75 -pw 1 'killall MiSTer'
plink root@$HOST -pw 1 'killall MiSTer'
set -e
ftp -n <<EOF
open 192.168.1.75
open $HOST
user root 1
binary
put MiSTer /media/fat/MiSTer
EOF
plink root@192.168.1.75 -pw 1 'sync;PATH=/media/fat:$PATH;MiSTer >/dev/ttyS0 2>/dev/ttyS0 </dev/null &'
plink root@$HOST -pw 1 'sync;PATH=/media/fat:$PATH;MiSTer >/dev/ttyS0 2>/dev/ttyS0 </dev/null &'