From 7f905a45c9860c106bc9affcbd7b1889f31343ba Mon Sep 17 00:00:00 2001 From: qo-op Date: Mon, 11 May 2020 07:19:41 +0200 Subject: [PATCH] root or $YOU --- g1sms/functions.sh | 2 +- g1sms/init_keys.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/g1sms/functions.sh b/g1sms/functions.sh index 105481e..54f129a 100755 --- a/g1sms/functions.sh +++ b/g1sms/functions.sh @@ -222,7 +222,7 @@ do silkajExitCode=$? ((i++)) - [ $i -gt 6 ] && continue + [ $i -gt 4 ] && continue done if [[ $silkajOutput =~ $silkajQuantitativeAmountPattern ]] diff --git a/g1sms/init_keys.sh b/g1sms/init_keys.sh index 9ddf487..e11f5c1 100755 --- a/g1sms/init_keys.sh +++ b/g1sms/init_keys.sh @@ -10,9 +10,14 @@ 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); -[[ $USER == $YOU ]] && IPFSNODEID=$(ipfs id -f='\n') \ -|| IPFSNODEID=$(su $YOU -c "ipfs id -f='\n'") # CASE root - +if [[ $USER == $YOU ]]; then + IPFSNODEID=$(ipfs id -f='\n') \ +else + # CASE root + IPFSNODEID=$(su $YOU -c "ipfs id -f='\n'") + chown -R $YOU /tmp/zen/ + chown $YOU /tmp/g1sms.log +fi NANODATE=$(date -u +%s%N) #1569692075385428020