Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
This commit is contained in:
parent
b7854c23b5
commit
1f1a10e7f6
|
@ -8,20 +8,18 @@
|
||||||
# Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
|
# Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
|
||||||
|
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
[[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]] && echo "bashrc already updated" && exit 1
|
[[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]] && er+="bashrc already updated"
|
||||||
|
|
||||||
echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc
|
|
||||||
|
|
||||||
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
|
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
|
||||||
[[ $er == "" ]] && echo "export YOU=$YOU" >> ~/.bashrc
|
|
||||||
|
|
||||||
# IPFS layer ID is $YOU Swarm peer ID
|
|
||||||
export IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
|
export IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
|
||||||
[[ $er == "" ]] && echo "export IPFSNODEID=$IPFSNODEID" >> ~/.bashrc
|
export G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) || er+=" ~/.zen/secret.dunikey not found"
|
||||||
|
|
||||||
# G1PUB is $YOU Zen Wallet (#libremoney)
|
[[ $er != "" ]] && echo "$er" && exit 1
|
||||||
export G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) || er+=" ~/.zen/secret.dunikey problem"
|
|
||||||
[[ $er == "" ]] && echo "export G1PUB=$G1PUB" >> ~/.bashrc
|
|
||||||
|
|
||||||
|
echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc
|
||||||
|
echo "export YOU=$YOU" >> ~/.bashrc
|
||||||
|
echo "export G1PUB=$G1PUB" >> ~/.bashrc
|
||||||
|
echo "export IPFSNODEID=$IPFSNODEID" >> ~/.bashrc
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue