upgrade_nextcloud
This commit is contained in:
@@ -1,161 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
<<COMMENT
|
|
||||||
underline=`tput smul`
|
|
||||||
nounderline=`tput rmul`
|
|
||||||
bold=`tput bold`
|
|
||||||
normal=`tput sgr0`
|
|
||||||
echo "toto"
|
|
||||||
|
|
||||||
echo -e "\033[1m bold \033[0m"
|
|
||||||
echo -e "\033[3m italic \033[0m"
|
|
||||||
echo -e "\033[4m underline \033[0m"
|
|
||||||
echo -e "\033[1;3;31m Red bold+italic \033[0m"
|
|
||||||
echo -e "\033[9m strikethrough \033[0m"
|
|
||||||
echo -e "\033[31m Red World \033[0m"
|
|
||||||
echo -e "\033[93m Yellow World \033[0m"
|
|
||||||
echo -e "\033[32m Green World \033[0m"
|
|
||||||
COMMENT
|
|
||||||
|
|
||||||
|
|
||||||
brew=0
|
|
||||||
casks=0
|
|
||||||
mas=0
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
|
|
||||||
cat <<EOM
|
|
||||||
Create Homebrew 's packages and Casks installed list:"
|
|
||||||
a brew-install.sh script is created next to this script..."
|
|
||||||
|
|
||||||
Usage: $(basename "$0") [OPTION]...
|
|
||||||
|
|
||||||
-b brew
|
|
||||||
-c casks
|
|
||||||
-m mas
|
|
||||||
-h display help
|
|
||||||
EOM
|
|
||||||
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
while getopts ":bcmh-:" option; do
|
|
||||||
|
|
||||||
if [ "$option" = "-" ] ; then
|
|
||||||
case $OPTARG in
|
|
||||||
help) option=h;;
|
|
||||||
brew) option=b;;
|
|
||||||
casks) option=c;;
|
|
||||||
mas) option=m;;
|
|
||||||
*) echo "Option $OPTARG inconnue";;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$option" in
|
|
||||||
b) brew=1;;
|
|
||||||
c) casks=1;;
|
|
||||||
m) mas=1;;
|
|
||||||
h) usage;;
|
|
||||||
?) echo "Option -$OPTARG inconnue"
|
|
||||||
usage;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
|
|
||||||
if [ -f brew-install.sh ]; then
|
|
||||||
echo -e "The file \033[93mbrew-install.sh\033[0m already exist! We erase it."
|
|
||||||
rm brew-install.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '#!/bin/bash' >> brew-install.sh
|
|
||||||
|
|
||||||
# function for installing homebrew
|
|
||||||
echo '
|
|
||||||
installHomebrew() {
|
|
||||||
echo -e "/n Installing Homebrew"
|
|
||||||
#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
||||||
#sudo chown -R $USER /usr/local/
|
|
||||||
#export $PATH=/usr/local/bin:$PATH
|
|
||||||
brew update
|
|
||||||
}' >> brew-install.sh
|
|
||||||
|
|
||||||
|
|
||||||
#if type xcode-select >&- && xpath=$( xcode-select --print-path ) &&
|
|
||||||
# test -d "${xpath}" && test -x "${xpath}" ; then
|
|
||||||
# #... is correctly installed
|
|
||||||
#else
|
|
||||||
# #... isn't correctly installed
|
|
||||||
#fi
|
|
||||||
|
|
||||||
|
|
||||||
# test if CLT is installed
|
|
||||||
echo '
|
|
||||||
# test if CLT is installed' >> brew-install.sh
|
|
||||||
echo '
|
|
||||||
clt=$(xcode-select --install 2>&1 | grep installed)
|
|
||||||
if [ -n "$clt" ]; then
|
|
||||||
echo "Command Line Tools (CLT) for Xcode already installed";
|
|
||||||
else
|
|
||||||
echo "Installing Command Line Tools (CLT) for Xcode";
|
|
||||||
fi' >> brew-install.sh
|
|
||||||
|
|
||||||
# test if homebrew is installed
|
|
||||||
echo '
|
|
||||||
# test if Homebrew is installed' >> brew-install.sh
|
|
||||||
echo '
|
|
||||||
if [[ $(command -v brew) == "" ]]; then
|
|
||||||
installHomebrew
|
|
||||||
else
|
|
||||||
echo "Updating Homebrew"
|
|
||||||
brew update
|
|
||||||
fi
|
|
||||||
' >> brew-install.sh
|
|
||||||
|
|
||||||
# test if mas is installed
|
|
||||||
echo '
|
|
||||||
# test if mas is installed' >> brew-install.sh
|
|
||||||
echo '
|
|
||||||
if [[ $(command -v mas) == "" ]]; then
|
|
||||||
brew install mas
|
|
||||||
else
|
|
||||||
echo "mas already installed"
|
|
||||||
fi
|
|
||||||
' >> brew-install.sh
|
|
||||||
|
|
||||||
if [[ "$brew" -eq 1 ]] || [[ "$casks" -eq 1 ]] || [[ "$mas" -eq 1 ]]; then
|
|
||||||
echo -e "\n# Brew tap list.\n" >> brew-install.sh
|
|
||||||
echo -e "🍺 Get Homebrew \033[3m\033[93mtap\033[0m list"
|
|
||||||
brew tap | sed -e 's/^/brew tap /' >> brew-install.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$brew" -eq 1 ]; then
|
|
||||||
echo -e "\n# Brew packages that I use alot.\n" >> brew-install.sh
|
|
||||||
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
|
|
||||||
brew list | sed -e 's/^/brew install /' >> brew-install.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$casks" -eq 1 ]; then
|
|
||||||
echo -e "\n# Some casks packages that I like.\n" >> brew-install.sh
|
|
||||||
echo -e "🍺 Get Homebrew \033[3m\033[93mCask\033[0m installed list"
|
|
||||||
brew cask list | sed -e 's/^/brew cask install /' >> brew-install.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# https://github.com/mas-cli/mas
|
|
||||||
if [ "$mas" -eq 1 ]; then
|
|
||||||
echo -e "\n# Mac App Store applications list.\n" >> brew-install.sh
|
|
||||||
echo -e "🍏 Get Mac App Store \033[3m\033[93mapplications\033[0m list"
|
|
||||||
#mas list | awk '{print $1}' | sed -e 's/^/mas install /' >> brew-install.sh
|
|
||||||
appfrommas=$(mas list)
|
|
||||||
while read -r line; do
|
|
||||||
number=$(echo "$line" | awk '{print $1}')
|
|
||||||
name=$(echo "$line" | awk -F "(" '{print $1}' | awk {'first = $1; $1=""; print $0'} | sed 's/^ //g')
|
|
||||||
echo "#$name" >> brew-install.sh
|
|
||||||
echo "mas install $number" >> brew-install.sh
|
|
||||||
echo " " >> brew-install.sh
|
|
||||||
done <<< "$appfrommas"
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod +x brew-install.sh
|
|
||||||
|
|
||||||
terminal-notifier -title 'brew-list' -message 'Packages & casks list created !' -sound 'Glass'
|
|
||||||
@@ -10,12 +10,12 @@ if [ "$host" = "DS916" ]; then
|
|||||||
|
|
||||||
cd $nc_dir || exit
|
cd $nc_dir || exit
|
||||||
|
|
||||||
sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --on
|
||||||
sudo -u http /usr/local/bin/php73 occ maintenance:repair
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:repair
|
||||||
echo ""
|
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 -e "\033[4mWhen the message 'Should the \"occ upgrade\" command be executed? [Y/n]' is displayed, you must choice 'n' (no)\033[0m"
|
||||||
echo ""
|
echo ""
|
||||||
sudo -u http /usr/local/bin/php73 updater/updater.phar
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M updater/updater.phar
|
||||||
|
|
||||||
# Should the "occ upgrade" command be executed? [Y/n] n
|
# Should the "occ upgrade" command be executed? [Y/n] n
|
||||||
# non
|
# non
|
||||||
@@ -23,9 +23,9 @@ if [ "$host" = "DS916" ]; then
|
|||||||
echo ""
|
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 -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 ""
|
echo ""
|
||||||
sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --on
|
||||||
sudo -u http /usr/local/bin/php73 occ upgrade
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ upgrade
|
||||||
sudo -u http /usr/local/bin/php73 occ maintenance:mode --off
|
sudo -u http /usr/local/bin/php74 -d memory_limit=1024M occ maintenance:mode --off
|
||||||
|
|
||||||
elif [ "$host" == "localhost" ]; then
|
elif [ "$host" == "localhost" ]; then
|
||||||
ip=$(hostname -I | awk '{print $1}')
|
ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|||||||
Reference in New Issue
Block a user