root or $YOU

This commit is contained in:
qo-op 2020-05-11 07:19:41 +02:00
parent 0b47e88c86
commit 7f905a45c9
2 changed files with 9 additions and 4 deletions

View File

@ -222,7 +222,7 @@ do
silkajExitCode=$?
((i++))
[ $i -gt 6 ] && continue
[ $i -gt 4 ] && continue
done
if [[ $silkajOutput =~ $silkajQuantitativeAmountPattern ]]

View File

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