From b0a875cfea58c0a557590a04a6432ce29a6c30ef Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 10 Mar 2017 15:18:52 +0100 Subject: [PATCH] First update is init --- first_update | 0 update | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 first_update diff --git a/first_update b/first_update new file mode 100644 index 0000000..e69de29 diff --git a/update b/update index 0b898f3..d8170dd 100755 --- a/update +++ b/update @@ -6,9 +6,22 @@ source $__DIR__/lib/include/bash/const; source $__DIR__/lib/include/bash/func; # [1] Send data + fetch configuration -test "$($SOURCE_DIR/lib/api/sync)" = "127" && slog "sync failed" - "update" && exit; +if [ -e /home/sats/satsd/source/first_update ]; then + + test "$($SOURCE_DIR/lib/api/init)" = "127" && slog "sync failed" - "update" && exit; + test $? -ne 0 && exit 127; + + rm /home/sats/satsd/source/first_update; +else + + test "$($SOURCE_DIR/lib/api/sync)" = "127" && slog "sync failed" - "update" && exit; + test $? -ne 0 && exit 127; +fi; + + + + -test $? -ne 0 && exit 127; # [2] Update source BRANCH=$(cat $BRANCH_CONF);