root OR pi
This commit is contained in:
parent
c38ed7e17f
commit
b46aa7e31e
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue