X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=rew;h=f73b526c7734d8a41423755a4ebb64d2213ca502;hp=860a3038a520432ede34f57bc08dfb048961500d;hb=79b274fcd8bfa556133ab13270e84b40aebe8468;hpb=ebd0ea323de3eacc11e1a624f8cc4f961d8bdb6c diff --git a/rew b/rew index 860a303..f73b526 100755 --- 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 ||: