From 785f715830a34a263c9e9a2275e26d95c9a67a8c Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 19:00:14 +0200 Subject: [PATCH] test --- include.sh | 13 +++++++++++++ install.sh | 31 +++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/include.sh b/include.sh index 0574219..cdebc7f 100644 --- a/include.sh +++ b/include.sh @@ -40,6 +40,10 @@ i_should_install() { [[ ! -f ~/.zen/secret.june ]] } +iso_config() { + ~/.zen/astrXbian/ISOconfig.sh +} + import_astrXbian() { mkdir -p ~/.zen cd ~/.zen @@ -49,3 +53,12 @@ import_astrXbian() { import_kodi() { cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ } + +prepare_next_boot() { + ## Rpi Xbian install. + cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0" + # PREPARE NEXT BOOT - Network config - NEXTBOOT - ISOConfig - NEXTBOOT - OK + echo "su - xbian -c '~/.zen/astrXbian/FirstBOOT.sh'" >> /tmp/new.rc.local + echo "exit 0" >> /tmp/new.rc.local + sudo cp -f /tmp/new.rc.local /etc/rc.local +} diff --git a/install.sh b/install.sh index 6e80ca9..1cceb48 100755 --- a/install.sh +++ b/install.sh @@ -39,12 +39,12 @@ 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 ### -[[ "$USER" == "xbian" ]] && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport') +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 [[ "$USER" == "xbian" ]] +if i_am_xbian then echo "enabling ipfs initV service autostart" cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs @@ -67,25 +67,20 @@ mkdir -p ~/astroport/film mkdir -p ~/astroport/serie mkdir -p ~/astroport/anime -if [[ "$USER" != "xbian" ]] +if ! i_am_xbian then - ## Desktop install - echo "INITIALISATIOn Astroport/KODI" - echo "Appuyez sur la touche ENTREE pour créer votre nouvelle identité" - echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde" - read - ~/.zen/astrXbian/ISOconfig.sh + ## Desktop install + echo "INITIALISATIOn Astroport/KODI" + echo "Appuyez sur la touche ENTREE pour créer votre nouvelle identité" + echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde" + read + iso_config else - ## Rpi Xbian install. - cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0" - # PREPARE NEXT BOOT - Network config - NEXTBOOT - ISOConfig - NEXTBOOT - OK - echo "su - xbian -c '~/.zen/astrXbian/FirstBOOT.sh'" >> /tmp/new.rc.local - echo "exit 0" >> /tmp/new.rc.local - sudo cp -f /tmp/new.rc.local /etc/rc.local + 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 + 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é) ##