09-03-2021

This commit is contained in:
2021-03-09 06:42:05 +01:00
parent b2e684f55d
commit b29574668f
3 changed files with 69 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
# prints a color table of 8bg * 8fg * 2 states (regular/bold)
echo
echo Table for 16-color terminal escape sequences.

View File

@@ -25,6 +25,7 @@ for fg in ${!FG[*]} ; do
echo ;
done
# Comment déclarer une couleur :
cat <<_eof_
@@ -33,4 +34,20 @@ cat <<_eof_
Retour aux paramètres par défaut : \033[0m" ;
Pour plus de détails : http://www.admin-linux.fr/?p=9011
ST: Style (0 à 9)
FG: Foreground (30 à 37)
BG: Background (40 à 47)
\\033[STm (ex Style Bold \\033[1m)
\\033[FGm (ex Text Red \\033[31m)
\\033[BGm (ex Background Red \\033[41m)
\\033[FG;BGm (ex Rouge sur fond Vert \\033[31;42m)
\\033[ST;FGm (ex Jaune souligné \\033[4;33m)
\\033[ST;FG;BGm (ex Jaune sur fond Bleu souligné \\033[4;33;44m)
_eof_

50
upgrade_nextcloud.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
host=$(hostname)
if [ "$host" = "DS916" ]; then
php_version=73
php_bin=/usr/local/bin/php$php_version
nc_dir=/volume1/web/nextcloud
cd $nc_dir || exit
sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
sudo -u http /usr/local/bin/php73 occ maintenance:repair
echo ""
echo -e "\033[4mWhen the message 'Should the \"occ upgrade\" command be executed? [Y/n]' is displayed, you must choice 'n' (no)\033[0m"
echo ""
sudo -u http /usr/local/bin/php73 updater/updater.phar
# Should the "occ upgrade" command be executed? [Y/n] n
# non
echo ""
echo -e "\033[4mLa version par défaut de PHP est la 5.6.11, ce qui est insuffisant (7.2 requis). On relance la suite avec la bonne version de php\033[0m"
echo ""
sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
sudo -u http /usr/local/bin/php73 occ upgrade
sudo -u http /usr/local/bin/php73 occ maintenance:mode --off
elif [ "$host" == "localhost" ]; then
ip=$(hostname -I | awk '{print $1}')
if [ "$ip" = "212.227.191.167" ]; then
php_version=7.3
php_bin=/opt/plesk/php/$php_version/bin/php
nc_dir=/var/www/vhosts/maboiteverte.fr/httpdocs/nextcloud
cd $nc_dir || exit
sudo -u bruno $php_bin occ maintenance:mode --on
sudo -u bruno $php_bin occ maintenance:repair
sudo -u bruno $php_bin updater/updater.phar
sudo -u bruno $php_bin occ upgrade
sudo -u bruno $php_bin occ maintenance:mode --off
fi
fi