Add environment variables for root

This commit is contained in:
poka 2020-05-19 20:54:50 +02:00
parent ef7c7b3355
commit e81f55d73a
1 changed files with 6 additions and 0 deletions

View File

@ -23,8 +23,14 @@ for i in $astroVars; do
[[ ! $(grep "$i=" $myProfile) && -n ${!i} ]] && echo "export $i=${!i}" >> $myProfile
done
# Export for user
[[ -n $(grep "/.zen/ipfs/" ~/.bashrc) ]] && sed -i -n '/\/.zen\/ipfs/!p' ~/.bashrc
[[ -n $(grep "# ASTROPORT " ~/.bashrc) ]] && sed -i -n '/# ASTROPORT /!p' ~/.bashrc
echo -e "# ASTROPORT ENVIRONMENT VARIABLE\n. /home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" >> ~/.bashrc
# Export for root
[[ -n $(sudo grep "/.zen/ipfs/" /root/.bashrc) ]] && sudo sed -i -n '/\/.zen\/ipfs/!p' /root/.bashrc
[[ -n $(sudo grep "# ASTROPORT " /root/.bashrc) ]] && sudo sed -i -n '/# ASTROPORT /!p' /root/.bashrc
echo -e "# ASTROPORT ENVIRONMENT VARIABLE\n. /home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" | sudo tee -a /root/.bashrc
[[ $1 != "noexec" ]] && exec bash