From 6ced07a351663dcef494bc0acb86b5d227b617b1 Mon Sep 17 00:00:00 2001 From: qo-op Date: Mon, 11 May 2020 07:54:32 +0200 Subject: [PATCH] IPFSNODEID --- g1sms/init_keys.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/g1sms/init_keys.sh b/g1sms/init_keys.sh index 78573ca..11004db 100755 --- a/g1sms/init_keys.sh +++ b/g1sms/init_keys.sh @@ -10,13 +10,12 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); -if [[ $(whoami) == $YOU ]]; then - IPFSNODEID=$(ipfs id -f='\n') -else - # CASE root - IPFSNODEID=$(su $YOU -c "ipfs id -f='\n'") +if [[ $(whoami) == "root" ]]; then + export IPFSNODEID=$(su $YOU -c "ipfs id -f='\n'") chown -R $YOU /tmp/zen/ chown $YOU /tmp/g1sms.log +else + export IPFSNODEID=$(ipfs id -f='\n') fi NANODATE=$(date -u +%s%N) #1569692075385428020