From f0036ca121ff14003b295dc71d2416ae86b47f92 Mon Sep 17 00:00:00 2001 From: Yann Autissier Date: Fri, 1 Jul 2022 19:25:45 +0200 Subject: [PATCH] fix install --- include.sh | 109 ++++++++++++++++++++++++++--------------------------- install.sh | 18 ++++++++- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/include.sh b/include.sh index c39653a..53c601c 100644 --- a/include.sh +++ b/include.sh @@ -1,11 +1,59 @@ #!/bin/bash [ "${DEBUG}" ] && set -x -check_requirements() { - [[ ! $(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 ; echo "mise à jour des dépots de votre distribution..." +i_am() { + echo 'v0.5.0' +} + +i_am_root() { + [ $(id -u) -eq 0 ] +} + +i_am_xbian() { + [[ "$USER" == "xbian" ]] +} + +i_should_install() { +[[ ! -f ~/.zen/secret.dunikey ]] +} + +import_astrXbian() { + echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" + mkdir -p ~/.zen + cd ~/.zen + # TODO INSTALL FROM IPFS / IPNS + git clone https://git.p2p.legal/axiom-team/astrXbian.git + git clone https://git.p2p.legal/qo-op/Astroport.ONE.git +} + +import_astroport() { + echo "INITIALISATIOn Astroport/KODI" + echo "Appuyez sur la touche ENTREE pour démarrer le mode Aventure" + echo "sinon interrompez ici l'installation, et activez votre Ambassade ~/.zen/Astroport.ONE/start.sh" + read + ~/.zen/Astroport.ONE/adventure.sh + # ~/.zen/astrXbian/ISOconfig.sh +} + +import_ipfs() { + ## Scripts pour systemd ou InitV (xbian) + echo "=== Activation SYSTEM IPFS" + ~/.zen/astrXbian/.install/ipfs_alone.sh +} + +import_jaklis() { + echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+" + cd ~/.zen/astrXbian/zen/jaklis + ./setup.sh +} + +import_kodi() { + echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" + cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ +} + +install_requirements() { + echo "mise à jour des dépots de votre distribution..." sudo apt-get update [[ "$user" != "xbian" ]] &&\ @@ -72,57 +120,6 @@ check_requirements() { sudo ln -f -s /usr/bin/python3 /usr/bin/python } -i_am() { - echo 'v0.5.0' -} - -i_am_root() { - [ $(id -u) -eq 0 ] -} - -i_am_xbian() { - [[ "$USER" == "xbian" ]] -} - -i_should_install() { -[[ ! -f ~/.zen/secret.dunikey ]] -} - -import_astrXbian() { - echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" - mkdir -p ~/.zen - cd ~/.zen - # TODO INSTALL FROM IPFS / IPNS - git clone https://git.p2p.legal/axiom-team/astrXbian.git - git clone https://git.p2p.legal/qo-op/Astroport.ONE.git -} - -import_astroport() { - echo "INITIALISATIOn Astroport/KODI" - echo "Appuyez sur la touche ENTREE pour démarrer le mode Aventure" - echo "sinon interrompez ici l'installation, et activez votre Ambassade ~/.zen/Astroport.ONE/start.sh" - read - ~/.zen/Astroport.ONE/adventure.sh - # ~/.zen/astrXbian/ISOconfig.sh -} - -import_ipfs() { - ## Scripts pour systemd ou InitV (xbian) - echo "=== Activation SYSTEM IPFS" - ~/.zen/astrXbian/.install/ipfs_alone.sh -} - -import_jaklis() { - echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+" - cd ~/.zen/astrXbian/zen/jaklis - ./setup.sh -} - -import_kodi() { - echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" - cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ -} - prepare_next_boot() { cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0" # PREPARE NEXT BOOT - Network config - NEXTBOOT - ISOConfig - NEXTBOOT - OK diff --git a/install.sh b/install.sh index 81f4c74..d56ec8d 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -. ./include.sh + ######################################################################## # Version: 0.5.0 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) @@ -9,14 +9,28 @@ 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 -check_requirements +install_requirements # Clone astrXbian and Astroport.One import_astrXbian