From 412bad810bb7d779fb6a5641746da3826dda308d Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 19 May 2020 20:43:35 +0200 Subject: [PATCH] [Nextcloud] Change php install --- .install/nextcloud/install.sh | 6 ++++-- .install/sys_checkOS.sh | 32 ++++++++++++++++++++++++-------- debug/reset_ipfs.sh | 12 +++++++++--- install.sh | 17 +++++++++++++++-- 4 files changed, 52 insertions(+), 15 deletions(-) diff --git a/.install/nextcloud/install.sh b/.install/nextcloud/install.sh index e3c2db3..0b7d703 100755 --- a/.install/nextcloud/install.sh +++ b/.install/nextcloud/install.sh @@ -49,9 +49,11 @@ apt update -y apt install nginx mariadb-server apt-transport-https curl gnupg2 git lsb-release ssl-cert ca-certificates apt-transport-https tree locate software-properties-common dirmngr screen htop net-tools zip unzip curl ffmpeg ghostscript libfile-fcntllock-perl -y -linux_version=$(cat /etc/os-release | grep VERSION_CODENAME | awk -F '=' '{ print $2}') +apt -y install lsb-release apt-transport-https ca-certificates +wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg + wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - -echo "deb https://packages.sury.org/php/ $linux_version main" | tee /etc/apt/sources.list.d/ondrej.list +echo "deb https://packages.sury.org/php/ $OS main" | tee /etc/apt/sources.list.d/ondrej.list apt update -y systemctl start nginx || (echo "Erreur quelque part ..." && exit 1) diff --git a/.install/sys_checkOS.sh b/.install/sys_checkOS.sh index 734e406..77bd0c7 100644 --- a/.install/sys_checkOS.sh +++ b/.install/sys_checkOS.sh @@ -1,14 +1,30 @@ #!/bin/bash -YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) -ipfsnodeid=$(ipfs id -f='\n') -myProfile="/home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" +astroVars="OS ARM YOU ipfsnodeid ASTROZEN ASTRONODE myProfile" + +export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +export ipfsnodeid=$(ipfs id -f='\n') +export ASTROZEN="/home/$YOU/.zen" +export ASTRONODE="$ASTROZEN/ipfs/.$ipfsnodeid" +export myProfile="$ASTRONODE/profile" + +[[ ! -d $ASTRONODE ]] && mkdir -p $ASTRONODE ## Check system kind -[[ $(uname -a | grep arm) ]] && ARM=yes || unset ARM -if [[ $(grep -E 'stretch|18.|19.' /etc/os-release) ]]; then OS=stretch; -elif [[ $(grep buster /etc/os-release) ]]; then OS=buster; +[[ $(uname -a | grep arm) ]] && export ARM=yes || unset ARM +if [[ $(grep -E 'stretch|18.|19.' /etc/os-release) ]]; then export OS=stretch; +elif [[ $(grep buster /etc/os-release) ]]; then export OS=buster; else echo "${c_red}OS not supported$c_"; exit 1; fi -[[ ! grep "OS=" $myProfile ]] && echo "OS=$OS" >> $myProfile -[[ ! grep "ARM=" $myProfile && -n $ARM ]] && echo "ARM=$ARM" >> $myProfile +[[ -e $myProfile ]] && rm $myProfile +touch $myProfile + +for i in $astroVars; do + [[ ! $(grep "$i=" $myProfile) && -n ${!i} ]] && echo "export $i=${!i}" >> $myProfile +done + +[[ -n $(grep "/.zen/ipfs/" ~/.bashrc) ]] && sed -i -n '/\/.zen\/ipfs/!p' ~/.bashrc +[[ -n $(grep "# ASTROPORT " ~/.bashrc) ]] && sed -i -n '/# ASTROPORT /!p' ~/.bashrc +echo -e "# ASTROPORT ENVIRONMENT VARIABLE\n. /home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" >> ~/.bashrc + +[[ $1 != "noexec" ]] && exec bash diff --git a/debug/reset_ipfs.sh b/debug/reset_ipfs.sh index e5b6ac1..b310ac5 100644 --- a/debug/reset_ipfs.sh +++ b/debug/reset_ipfs.sh @@ -1,6 +1,12 @@ #!/bin/bash -shopt -s extglob -cd /home/$YOU/.zen -rm -rf !(astroport) +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +sudo systemctl stop ipfs + +shopt -s extglob +cd /home/$YOU || exit 1 +rm -rf .ipfs/ + +cd .zen || exit 1 +rm -rf !(astroport) diff --git a/install.sh b/install.sh index a3e93eb..aae1520 100644 --- a/install.sh +++ b/install.sh @@ -2,18 +2,31 @@ # Check requierments { + sudo apt update sudo apt install curl net-tools -y +gitpath="https://git.p2p.legal/axiom-team/astroport/raw/master" + +echo "Add colors ..." +curl -s $gitpath/.install/export_colors.sh | bash || exit 1 +[[ -n $(grep ".bash_aliases" ~/.bashrc) ]] && echo ". ~/.bash_aliases" ~/.bashrc + echo "${c_green}Astroport installer ### 1. IPFS Swarm Layer$c_" # Full automatic (you trust this git depot) -curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/.install/ipfs_alone.sh | bash || exit 1 +curl -s $gitpath/.install/ipfs_alone.sh | bash || exit 1 + +# Set environment variables +curl -s $gitpath/.install/sys_checkOS.sh noexec | bash || exit 1 echo "${c_green}2. Ḡ1/ScuttleButt anoptical layer$c_" # ONCE YOU READ and AGREE. Run TrustFull QUICK Install !! -curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/make_G1SSB_secret.sh | bash || exit 1 +curl -s $gitpath/zen/tools/make_G1SSB_secret.sh | bash || exit 1 echo "${c_green}Installation complete$c_" + +exec bash + }