astrXbian/install.sh

127 lines
4.0 KiB
Bash
Executable File

#!/bin/bash
########################################################################
# Version: 0.5.0
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
{
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# INSTALLATION section of README does wget file install.sh and run it with bash
if [ -f ${MY_PATH}/include.sh ]; then
. ${MY_PATH}/include.sh
else
. <(wget -T3 -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/include.sh)
fi
! type i_should_install >/dev/null 2>&1 && echo 'ERROR: Unable to load include.sh' && exit 1
i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
# MAIN # SI AUCUNE CLEF DE STATION...
if i_should_install;
then
[[ ! $(which ipfs) ]] && echo "=== installez ipfs !!" && echo "https://docs.ipfs.io/install/command-line/#official-distributions" && exit 1
echo "astrxbian installateur pour distributions debian et dérivées : linuxmint (https://www.linuxmint.com/) ou xbian (https://xbian.org) recommandées"
echo "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications)
echo
# Install requirements
install_requirements
# Clone astrXbian and Astroport.One
import_astrXbian
# Init ipfs
# import_ipfs
# Copy astroport config in kodi
# import_kodi
# Jaklis setup
import_jaklis
########################################################################
echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN"
## XBIAN fail2ban ERROR correction ##
#[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
i_am_xbian && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf
# NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh
### MODIFIYING /etc/sudoers ###
i_am_xbian && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport')
# PERSONNAL DEFCON LEVEL
# cp ~/.zen/astrXbian/DEFCON ~/.zen/
if i_am_xbian
then
echo "enabling ipfs initV service autostart"
cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs
cd /etc/rc3.d && sudo ln -s ../init.d/ipfs S02ipfs
cd /etc/rc4.d && sudo ln -s ../init.d/ipfs S02ipfs
cd /etc/rc5.d && sudo ln -s ../init.d/ipfs S02ipfs
cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs
cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs
cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs
# Disable xbian-config auto launch
echo 0 > ~/.xbian-config-start
fi
########################################################################
# CREATE ~/astroport FILESYSTEM GATE
mkdir -p ~/astroport/film
mkdir -p ~/astroport/serie
mkdir -p ~/astroport/anime
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt
#######################################################################
echo "## INSTALL open_with_linux.py ##
## https://darktrojan.github.io/openwith/webextension.html"
~/.zen/astrXbian/open_with_linux.py install
echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !!
# https://addons.mozilla.org/firefox/addon/open-with/
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
if ! i_am_xbian
then
## Desktop install
import_astroport
else
## Rpi Xbian install.
prepare_next_boot
echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI"
echo "Faites une ISO : sudo xbian-config"
exit 0
fi
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
else
echo "Installation existante !!
========================
Astroport/KODI (Gchange)
========================
Connectez-vous sur https://gchange.fr avec vos identifiants
$(cat ~/.zen/secret.june)
https://astroport.com
"
# MAIN #
fi
}
~/.zen/astrXbian/zen/cron_VRFY.sh