lots of fixes for trisquel flidas
[distro-setup] / rew
diff --git a/rew b/rew
index 860a3038a520432ede34f57bc08dfb048961500d..2ce3a665dba9a5496d888d676354845cd792fad8 100755 (executable)
--- a/rew
+++ b/rew
@@ -1,13 +1,27 @@
 #!/bin/bash
-p="$(lsof -i tcp:31416 -Fp -a -c java | sed -rn 's/^p//p')"
+
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+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 &
+
+# so we don't hold open the /a fs
+sudo rsync -r --delete /a/opt/gnirehtet /opt
+cd /opt/gnirehtet
+
+# just running it in foreground so it's easier to kill etc.
+./gnirehtet rt
+
+
 # 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 ||: