From 5e0de2cd30d36674a8adc32885703753e75c8012 Mon Sep 17 00:00:00 2001 From: Stefaan Ghysels Date: Thu, 3 Oct 2019 17:11:13 +0200 Subject: [PATCH] Improve remote installer --- build_and_install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build_and_install.sh b/build_and_install.sh index d769314..9d3efa2 100755 --- a/build_and_install.sh +++ b/build_and_install.sh @@ -60,7 +60,13 @@ cssh=ssh echo echo "Install the app" -$cssh $TARGET "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin /usr/sbin/upload_apkg -rapp.bin -d -f1 -g1 && echo 'SUCCESS!'" +ALREADY_INSTALLED=$($cssh $TARGET "del_apkg whatever | grep ${PACKAGE}") +if [ -n "${ALREADY_INSTALLED}" ]; then + $cssh $TARGET "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin /usr/sbin/upload_apkg -rapp.bin -d -f1 -g1 && echo 'SUCCESS!'" +else + echo "Warning: this usually doesn't work!" + $cssh $TARGET "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin /usr/sbin/upload_apkg -papp.bin -t2 -d -f0 -g1 && echo 'SUCCESS!'" +fi TEST=tests/$PACKAGE/test.sh