astrXbian/install.sh

127 lines
4.0 KiB
Bash
Raw Permalink Normal View History

2020-12-12 01:26:39 +01:00
#!/bin/bash
2022-07-01 19:25:45 +02:00
2021-01-31 22:51:25 +01:00
########################################################################
# Version: 0.5.0
2021-01-31 22:51:25 +01:00
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
2020-12-12 01:26:39 +01:00
{
2022-05-05 03:31:08 +02:00
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
2022-04-24 17:22:32 +02:00
ME="${0##*/}"
2022-07-01 19:25:45 +02:00
# 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
2021-05-09 19:27:07 +02:00
i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
2021-02-19 15:51:10 +01:00
2022-04-24 17:22:32 +02:00
# MAIN # SI AUCUNE CLEF DE STATION...
2021-05-09 19:27:07 +02:00
if i_should_install;
2021-02-19 15:51:10 +01:00
then
2021-01-31 22:51:25 +01:00
2022-07-01 19:25:45 +02:00
[[ ! $(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
2022-07-01 19:25:45 +02:00
install_requirements
2021-01-31 22:51:25 +01:00
# Clone astrXbian and Astroport.One
import_astrXbian
2021-01-31 22:51:25 +01:00
# Init ipfs
2022-07-25 19:27:19 +02:00
# import_ipfs
2021-01-31 22:51:25 +01:00
# Copy astroport config in kodi
2022-07-25 19:27:19 +02:00
# import_kodi
2021-01-31 22:51:25 +01:00
# Jaklis setup
2021-05-15 18:31:46 +02:00
import_jaklis
2021-01-31 22:51:25 +01:00
########################################################################
2022-04-24 17:22:32 +02:00
echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN"
2021-08-11 20:30:53 +02:00
## XBIAN fail2ban ERROR correction ##
#[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
2021-05-12 18:47:13 +02:00
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
2021-01-31 22:51:25 +01:00
### MODIFIYING /etc/sudoers ###
2021-05-12 19:00:14 +02:00
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/
2020-12-13 20:23:50 +01:00
2021-05-12 19:00:14 +02:00
if i_am_xbian
2021-01-31 16:47:27 +01:00
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
2021-08-11 20:30:53 +02:00
# Disable xbian-config auto launch
echo 0 > ~/.xbian-config-start
2021-03-10 06:47:32 +01:00
2021-01-31 16:47:27 +01:00
fi
2021-01-31 22:51:25 +01:00
########################################################################
# CREATE ~/astroport FILESYSTEM GATE
mkdir -p ~/astroport/film
mkdir -p ~/astroport/serie
mkdir -p ~/astroport/anime
2022-05-14 15:56:55 +02:00
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt
2021-08-16 21:04:35 +02:00
#######################################################################
2022-04-24 17:22:32 +02:00
echo "## INSTALL open_with_linux.py ##
## https://darktrojan.github.io/openwith/webextension.html"
2021-08-12 11:25:39 +02:00
~/.zen/astrXbian/open_with_linux.py install
2022-04-24 17:22:32 +02:00
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"
2021-05-12 19:00:14 +02:00
if ! i_am_xbian
then
2021-05-12 19:00:14 +02:00
## Desktop install
import_astroport
else
## Rpi Xbian install.
2021-05-12 19:00:14 +02:00
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
2021-02-19 15:51:10 +01:00
fi
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
else
2022-05-14 15:56:55 +02:00
echo "Installation existante !!
========================
Astroport/KODI (Gchange)
========================
2021-08-11 20:30:53 +02:00
Connectez-vous sur https://gchange.fr avec vos identifiants
2020-12-13 20:42:15 +01:00
$(cat ~/.zen/secret.june)
2020-12-13 20:42:15 +01:00
https://astroport.com
2021-01-31 22:51:25 +01:00
"
# MAIN #
fi
2021-01-31 22:51:25 +01:00
}
2022-07-25 19:27:19 +02:00
~/.zen/astrXbian/zen/cron_VRFY.sh