root or $YOU
This commit is contained in:
parent
0b47e88c86
commit
7f905a45c9
|
@ -222,7 +222,7 @@ do
|
|||
silkajExitCode=$?
|
||||
|
||||
((i++))
|
||||
[ $i -gt 6 ] && continue
|
||||
[ $i -gt 4 ] && continue
|
||||
done
|
||||
|
||||
if [[ $silkajOutput =~ $silkajQuantitativeAmountPattern ]]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue