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