minor bug fix
[distro-setup] / rew
diff --git a/rew b/rew
index 860a3038a520432ede34f57bc08dfb048961500d..f73b526c7734d8a41423755a4ebb64d2213ca502 100755 (executable)
--- a/rew
+++ b/rew
@@ -1,13 +1,28 @@
 #!/bin/bash
-p="$(lsof -i tcp:31416 -Fp -a -c java | sed -rn 's/^p//p')"
-if [[ $p ]]; then
-    kill $p
-fi
-cd /a/opt/gnirehtet
-./gnirehtet rt &>/tmp/rt &
+
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+# using the rust version now, not sure the equivalent
+# p="$(lsof -i tcp:31416 -Fp -a -c java | sed -rn 's/^p//p')" ||:
+# if [[ $p ]]; then
+#     kill $p
+# fi
+
+# so we don't hold open the /a fs
+sudo rsync -r --delete /a/opt/gnirehtet-rust-linux64 /opt
+cd /opt/gnirehtet-rust-linux64
+
+# just running it in foreground so it's easier to kill etc.
+./gnirehtet run
+
+
 # note, to kill it, you need to also kill
 # lsof -i tcp:31416
 # and maybe unplug adb cable
 # note, ping results in log message: dropping invalid packet
 
-tail -F /tmp/rt ||:
+
+#./gnirehtet rt &>/tmp/rt &
+
+#tail -F /tmp/rt ||: