From f90843152cdb866a2685d63dc635001f32f4288a Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 12 Mar 2021 01:02:10 +0100 Subject: [PATCH] Add verification ipfs is running + ~/.zen/secret.dunikey exists --- zen/bash_template.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/bash_template.sh b/zen/bash_template.sh index fedfcc8..4e0c08e 100755 --- a/zen/bash_template.sh +++ b/zen/bash_template.sh @@ -7,9 +7,9 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" -YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 IPFSNODEID=$(ipfs id -f='\n') -G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1