93 lines
2.3 KiB
Bash
Executable File
93 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
################################################################################
|
|
# Author: Poka (poka@p2p.legal)
|
|
# Version: 0.0.1
|
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
# Git: https://git.p2p.legal/axiom-team/astroport
|
|
################################################################################
|
|
|
|
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
|
|
|
|
echo -e "Installing IPTubes"
|
|
|
|
# Install IPFS
|
|
ipfs() {
|
|
curl -s $giturl/axiom-team/astroport/raw/master/.install/ipfs.sh | bash -s ipfs
|
|
}
|
|
|
|
# Install ScuttleButt
|
|
sbotc() {
|
|
curl -s $giturl/axiom-team/astroport/raw/master/.install/scuttlebutt.sh | bash -s scuttlebutt
|
|
}
|
|
|
|
# Install Transmission
|
|
transmission() {
|
|
echo -e "${c_yellow}Installing Transmision...$c_"
|
|
sudo apt install transmission-daemon --install-suggests
|
|
}
|
|
|
|
# Install pip tools
|
|
piptools() {
|
|
sudo apt install python3-pip
|
|
pip3 install --user pyped
|
|
export PATH=$PATH:/home/iptubes/.local/bin
|
|
}
|
|
|
|
torrengo() {
|
|
## Install GO
|
|
wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz -P /tmp/
|
|
sudo tar -C /usr/local -xzf /tmp/go1.13.4.linux-amd64.tar.gz
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
source ~/.profile
|
|
|
|
## Install torrengo
|
|
go get github.com/juliensalinas/torrengo
|
|
go build github.com/juliensalinas/torrengo
|
|
go get github.com/juliensalinas/torrengo/ygg
|
|
|
|
sudo chmod ug+x torrengo
|
|
pathTorrengo=$(realpath torrengo)
|
|
cd /usr/bin
|
|
sudo ln -sf $pathTorrengo .
|
|
|
|
rm /tmp/go1.13.4.linux-amd64.tar.gz
|
|
}
|
|
|
|
pip3() {
|
|
sudo apt install python3-pip
|
|
|
|
}
|
|
|
|
iptubes() {
|
|
[[ -z $(which pip3) ]] && pip3
|
|
/usr/bin/pip3 install $(curl -s https://raw.githubusercontent.com/Harkame/YggTorrentScraper/master/requirements.txt)
|
|
chgrp -R debian-transmission data/
|
|
chmod -R g+w data/
|
|
sudo service transmission-daemon restart
|
|
cp login.py.template login.py
|
|
cd lib/py/
|
|
ln -sf ../../login.py .
|
|
|
|
echo "You will be ask to fill login.py in 2 seconds ..."
|
|
|
|
nano login.py
|
|
}
|
|
|
|
# Check installs
|
|
[[ -z $(which ipfs) ]] && ipfs
|
|
[[ -z $(which sbotc) ]] && sbotc
|
|
[[ -z $(which transmission-daemon) ]] && transmission
|
|
|
|
$@
|
|
|
|
echo -e "Installation Complete"
|
|
|
|
exit 0
|