1
0
Fork 0

fix installations problems ...

This commit is contained in:
poka 2020-05-06 17:32:52 +02:00
parent f4d781c0d3
commit c5caef80ff
3 changed files with 24 additions and 27 deletions

View File

@ -1,27 +0,0 @@
#!/bin/bash
# Check if this script is not execute inside astroport folder
[[ $(basename "$PWD") == "astroport" ]] && echo "DO NOT EXECUTE THIS SCRIPT INSIDE ASTROPORT FOLDER!" && exit 1
[[ -d astroport ]] && rm -rf astroport && echo "astroport folder has been deleted."
[[ -z $(which git) ]] && echo "installation de git..." && sudo apt install git
isp2plegal=$(nc -zv -w 1 192.168.9.19 3000 2<&1)
if [[ "$isp2plegal" =~ "(?) open" ]]; then
isp2plegalbool=true
giturl="http://192.168.9.19:3000"
else
isp2plegalbool=false
giturl="https://git.p2p.legal"
fi
git clone $giturl/axiom-team/astroport.git
cd astroport
[[ $isp2plegalbool == true ]] && sed -i 's/https:\/\/git.p2p.legal/http:\/\/192.168.9.19:3000/g' .gitmodules && echo "Infra p2p.legal detected, switch remotes submodules"
echo -e '#!/bin/bash\n./git-update.sh' > .git/hooks/post-merge
git submodule update --init --recursive
source ./git-update.sh
echo "Astroport ready to go!"
exit 0

View File

@ -1,7 +1,29 @@
#!/bin/bash
# Check if astroport folder exist
[[ -d astroport ]] && rm -rf astroport && echo "astroport folder has been deleted."
[[ -z $(which git) ]] && echo "installation de git..." && sudo apt install git
isp2plegal=$(nc -zv -w 1 192.168.9.19 3000 2<&1)
if [[ "$isp2plegal" =~ "(?) open" ]]; then
isp2plegalbool=true
giturl="http://192.168.9.19:3000"
else
isp2plegalbool=false
giturl="https://git.p2p.legal"
fi
[[ ${PWD##*/} != astroport ]] && git clone $giturl/axiom-team/astroport.git && cd astroport
[[ $isp2plegalbool == true ]] && sed -i 's/https:\/\/git.p2p.legal/http:\/\/192.168.9.19:3000/g' .gitmodules && echo "Infra p2p.legal detected, switch remotes submodules"
echo -e '#!/bin/bash\n./git-update.sh' > .git/hooks/post-merge
git submodule update --init --recursive
#source ./git-update.sh
echo "Updating git submodules ..."
git submodule foreach git pull origin master
echo "Astroport updated!"
echo "Astroport ready to go!"
exit 0

View File

@ -13,6 +13,8 @@ if [ "$EUID" -eq 0 ]
exit 1
fi
source ./git-update.sh
echo -e "Installing Astroport"
MY_PATH="`dirname \"$0\"`"