Compare commits

..

3 Commits

19 changed files with 128 additions and 684 deletions

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -216,34 +217,9 @@ echo -e "\033[32m-----\033[m"
echo "Add missing columns"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -409,7 +385,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -216,34 +217,9 @@ echo -e "\033[32m-----\033[m"
echo "Create missing indices"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -409,7 +385,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $CURRENT_INSTALL_DIR | cut -d"-" -f2)"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -216,34 +217,9 @@ echo -e "\033[32m-----\033[m"
echo "Create missing indices"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -409,7 +385,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -254,34 +255,9 @@ echo -e "\033[32m-----\033[m"
echo -e "Add User to Group - \033[1mBoth, User and Group has to exist\033[m"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Cloud instance that you want to change?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -447,7 +423,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -225,33 +226,9 @@ echo "Create missing indices"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -419,81 +396,7 @@ fi
# Check PHP Version
#
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
if [[ -z "$PHP_VERSION" ]] ; then
if [[ -z "$VHOST_CONFIG_FILE" ]] ; then
if $NGINX_IS_ENABLED ; then
if [[ -f "/etc/nginx/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="$(realpath "/etc/nginx/sites-enabled/${WEBSITE}.conf")"
fi
elif $APACHE2_IS_ENABLED ; then
if [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm"
elif [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf"
elif [[ -f "/etc/apache2/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/etc/apache2/sites-enabled/${WEBSITE}.conf"
fi
fi
fi
if [[ -n "$VHOST_CONFIG_FILE" ]] ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" $VHOST_CONFIG_FILE \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
fi
if [[ -z "$PHP_VERSION" ]] ; then
if $NGINX_IS_ENABLED ; then
upstream_handler="$(grep -o -E "^[^#]*fastcgi_pass\s+[^;]+" ${VHOST_CONFIG_FILE} | awk '{print$2}' )"
for _file in $(ls /etc/nginx/conf.d/) ; do
_rp_file="$(realpath "/etc/nginx/conf.d/${_file}")"
if $(grep -q -E "\s+${upstream_handler}\s*" ${_rp_file} 2> /dev/null) ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" ${_rp_file} \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
break
fi
done
fi
if [[ -z "$PHP_VERSION" ]] ; then
warn "Cannot determin the PHP version\! Enter it manually"
main_version_regex="^[[:digit:]]{1,2}\.[[:digit:]]{1}$"
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo "Enter the PHP main version, e.g. 7.4 or 8.2 .."
echo ""
echo ""
PHP_VERSION=
while [ "X$PHP_VERSION" = "X" ]
do
echononl " PHP main version: "
read PHP_VERSION
if [ "X$PHP_VERSION" = "X" ]; then
echo ""
echo -e "\033[33m\033[1mInput is required !!\033[m"
echo ""
fi
if [[ ! $PHP_VERSION =~ $main_version_regex ]] ; then
echo ""
echo -e "\033[33m\033[1mWrong entry (${PHP_VERSION}) for main PHP version !!\033[m"
echo ""
PHP_VERSION=
fi
done
fi
fi
fi
fi
source ${snippet_dir}/get-php-major-version
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -225,32 +226,9 @@ echo -e "Add User to Group - \033[1mBoth, User and Group has to exist\033[m"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Cloud instance that you want to change?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -419,81 +397,7 @@ fi
# Check PHP Version
#
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
if [[ -z "$PHP_VERSION" ]] ; then
if [[ -z "$VHOST_CONFIG_FILE" ]] ; then
if $NGINX_IS_ENABLED ; then
if [[ -f "/etc/nginx/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="$(realpath "/etc/nginx/sites-enabled/${WEBSITE}.conf")"
fi
elif $APACHE2_IS_ENABLED ; then
if [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm"
elif [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf"
elif [[ -f "/etc/apache2/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/etc/apache2/sites-enabled/${WEBSITE}.conf"
fi
fi
fi
if [[ -n "$VHOST_CONFIG_FILE" ]] ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" $VHOST_CONFIG_FILE \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
fi
if [[ -z "$PHP_VERSION" ]] ; then
if $NGINX_IS_ENABLED ; then
upstream_handler="$(grep -o -E "^[^#]*fastcgi_pass\s+[^;]+" ${VHOST_CONFIG_FILE} | awk '{print$2}' )"
for _file in $(ls /etc/nginx/conf.d/) ; do
_rp_file="$(realpath "/etc/nginx/conf.d/${_file}")"
if $(grep -q -E "\s+${upstream_handler}\s*" ${_rp_file} 2> /dev/null) ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" ${_rp_file} \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
break
fi
done
fi
if [[ -z "$PHP_VERSION" ]] ; then
warn "Cannot determin the PHP version\! Enter it manually"
main_version_regex="^[[:digit:]]{1,2}\.[[:digit:]]{1}$"
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo "Enter the PHP main version, e.g. 7.4 or 8.2 .."
echo ""
echo ""
PHP_VERSION=
while [ "X$PHP_VERSION" = "X" ]
do
echononl " PHP main version: "
read PHP_VERSION
if [ "X$PHP_VERSION" = "X" ]; then
echo ""
echo -e "\033[33m\033[1mInput is required !!\033[m"
echo ""
fi
if [[ ! $PHP_VERSION =~ $main_version_regex ]] ; then
echo ""
echo -e "\033[33m\033[1mWrong entry (${PHP_VERSION}) for main PHP version !!\033[m"
echo ""
PHP_VERSION=
fi
done
fi
fi
fi
fi
source ${snippet_dir}/get-php-major-version
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -225,33 +226,9 @@ echo "Create missing indices"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -419,81 +396,7 @@ fi
# Check PHP Version
#
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
if [[ -z "$PHP_VERSION" ]] ; then
if [[ -z "$VHOST_CONFIG_FILE" ]] ; then
if $NGINX_IS_ENABLED ; then
if [[ -f "/etc/nginx/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="$(realpath "/etc/nginx/sites-enabled/${WEBSITE}.conf")"
fi
elif $APACHE2_IS_ENABLED ; then
if [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm"
elif [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf"
elif [[ -f "/etc/apache2/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/etc/apache2/sites-enabled/${WEBSITE}.conf"
fi
fi
fi
if [[ -n "$VHOST_CONFIG_FILE" ]] ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" $VHOST_CONFIG_FILE \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
fi
if [[ -z "$PHP_VERSION" ]] ; then
if $NGINX_IS_ENABLED ; then
upstream_handler="$(grep -o -E "^[^#]*fastcgi_pass\s+[^;]+" ${VHOST_CONFIG_FILE} | awk '{print$2}' )"
for _file in $(ls /etc/nginx/conf.d/) ; do
_rp_file="$(realpath "/etc/nginx/conf.d/${_file}")"
if $(grep -q -E "\s+${upstream_handler}\s*" ${_rp_file} 2> /dev/null) ; then
PHP_VERSION="$(grep -o -E "^[^#]*php-?[[:digit:]]{1,2}\.[[:digit:]]{1}-fpm" ${_rp_file} \
| grep -o -E "[[:digit:]]{1,2}\.[[:digit:]]{1}")"
break
fi
done
fi
if [[ -z "$PHP_VERSION" ]] ; then
warn "Cannot determin the PHP version\! Enter it manually"
main_version_regex="^[[:digit:]]{1,2}\.[[:digit:]]{1}$"
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo "Enter the PHP main version, e.g. 7.4 or 8.2 .."
echo ""
echo ""
PHP_VERSION=
while [ "X$PHP_VERSION" = "X" ]
do
echononl " PHP main version: "
read PHP_VERSION
if [ "X$PHP_VERSION" = "X" ]; then
echo ""
echo -e "\033[33m\033[1mInput is required !!\033[m"
echo ""
fi
if [[ ! $PHP_VERSION =~ $main_version_regex ]] ; then
echo ""
echo -e "\033[33m\033[1mWrong entry (${PHP_VERSION}) for main PHP version !!\033[m"
echo ""
PHP_VERSION=
fi
done
fi
fi
fi
fi
source ${snippet_dir}/get-php-major-version
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"

View File

@ -4,6 +4,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -196,7 +197,23 @@ while getopts hs: opt ; do
done
if [[ -z "$WEBSITE" ]] ; then
fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
while IFS='' read -r -d '' _conf_file ; do
source $_conf_file
if [[ -n "$WEBSITE" ]] ; then
unsorted_website_arr+=("${WEBSITE}:$_conf_file")
fi
WEBSITE=""
done < <(find "${conf_dir}" -maxdepth 1 -type f -name "*.conf" -print0)
# - Sort array
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
fi
WEB_BASE_DIR="/var/www/${WEBSITE}"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -216,38 +217,10 @@ if [[ -z "$WEBSITE" ]] ; then
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
WEBSITE="$_WEBSITE"
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -215,35 +216,9 @@ if [[ -z "$WEBSITE" ]] ; then
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
WEBSITE="$_WEBSITE"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -215,35 +216,9 @@ if [[ -z "$WEBSITE" ]] ; then
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
WEBSITE="$_WEBSITE"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -255,33 +256,9 @@ echo -e "Remove User from Group - \033[1mBoth, User and Group has to exist\033[m
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Cloud instance that you want to change?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -447,7 +424,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -213,37 +214,13 @@ clear
echo ""
echo -e "\033[32m-----\033[m"
echo "Create missing indices"
echo "Replace favicon icon"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -277,10 +254,6 @@ DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE="FPM"
if [[ -z ${WEBSITE} ]] ; then
WEBSITE="$DEFAULT_WEBSITE"
fi
DEFAULT_WEB_BASE_DIR="/var/www/$WEBSITE"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
@ -412,7 +385,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
echo ""
echo -e " \033[32m--\033[m"

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -217,33 +218,9 @@ echo "Create missing indices"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
DEFAULT_WEBSITE="${_arr[0]}"
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -277,10 +254,6 @@ DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE="FPM"
if [[ -z ${WEBSITE} ]] ; then
WEBSITE="$DEFAULT_WEBSITE"
fi
DEFAULT_WEB_BASE_DIR="/var/www/$WEBSITE"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
@ -412,7 +385,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
echo ""

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -222,32 +223,9 @@ echo "Update Nextcloud"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to restore?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -404,33 +382,7 @@ fi
# Check PHP Version
#
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
if [[ -z "$PHP_VERSION" ]] ; then
if [[ -z "$VHOST_CONFIG_FILE" ]] ; then
if $NGINX_IS_ENABLED ; then
if [[ -f "/etc/nginx/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE=""
fi
elif $APACHE2_IS_ENABLED ; then
if [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf.php-fpm"
elif [[ -f "/usr/local/apache2/conf/vhosts/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/usr/local/apache2/conf/vhosts/${WEBSITE}.conf"
elif [[ -f "/etc/apache2/sites-enabled/${WEBSITE}.conf" ]] ; then
VHOST_CONFIG_FILE="/etc/apache2/sites-enabled/${WEBSITE}.conf"
fi
fi
fi
PHP_VERSION="$(grep -o -E "php-?.{1}\..{1}-fpm" $VHOST_CONFIG_FILE | grep -o -E ".{1}\..{1}")"
if [[ -z "$PHP_VERSION" ]] ; then
fatal "PHP Version must be givven if running PHP-FPM engine (parameter 'PHP_VERSION')"
fi
fi
fi
source ${snippet_dir}/get-php-major-version

View File

@ -0,0 +1,36 @@
WEBSITE=
_OK=false
declare -i i=0
if [[ ${#website_arr[@]} -eq 1 ]] ; then
IFS=':' read -a _arr <<< ${website_arr[0]}
conf_file=${_arr[1]}
WEBSITE=${_arr[0]}
echo ""
echo -e "Update site \033[1m ${_arr[0]}"
echo ""
else
echo ""
echo "Which site would you like to update?"
echo ""
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
WEBSITE=${_arr[0]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
fi

View File

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -246,32 +247,9 @@ echo "Update Nextcloud"
echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -500,7 +478,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
# - Determin PHP binary