IPFSNODEID

This commit is contained in:
qo-op 2020-05-11 07:54:32 +02:00
parent daa89ece9a
commit 6ced07a351
1 changed files with 4 additions and 5 deletions

View File

@ -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='<id>\n')
else
# CASE root
IPFSNODEID=$(su $YOU -c "ipfs id -f='<id>\n'")
if [[ $(whoami) == "root" ]]; then
export IPFSNODEID=$(su $YOU -c "ipfs id -f='<id>\n'")
chown -R $YOU /tmp/zen/
chown $YOU /tmp/g1sms.log
else
export IPFSNODEID=$(ipfs id -f='<id>\n')
fi
NANODATE=$(date -u +%s%N) #1569692075385428020