root OR pi

This commit is contained in:
qo-op 2020-05-11 15:16:32 +02:00
parent c38ed7e17f
commit b46aa7e31e
2 changed files with 6 additions and 10 deletions

View File

@ -8,15 +8,7 @@ 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) == "root" ]]; then
su - $YOU
cd $MY_PATH
export IPFSNODEID=$(ipfs id -f='<id>\n')
#chown -R $YOU /tmp/zen/
#chown $YOU /tmp/g1sms.log
else
export IPFSNODEID=$(ipfs id -f='<id>\n')
fi
export IPFSNODEID=$(ipfs id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "PROBLEM GETTING IPFSNODEID" && exit 1
[[ ! $(which bc) ]] && sudo apt-get install bc -y ## TODO: migration need TO REMOVE

View File

@ -7,11 +7,15 @@
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) == "root" ]]; then
su - $YOU
cd $MY_PATH
fi
# Execute Kalkun daemon
[[ -f /var/www/kalkun/scripts/daemon.sh ]] && /var/www/kalkun/scripts/daemon.sh
export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
cd $MY_PATH
source ./init.sh
source ./functions.sh