Moves user check into Apache usecase.

This commit is contained in:
Llewellyn van der Merwe 2022-01-20 14:14:08 +02:00
parent 6b42540f50
commit 66e04002a2
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
13 changed files with 182 additions and 169 deletions

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then

View File

@ -18,16 +18,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
pound='#'
user="${user#$pound}"
group="${group#$pound}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
# set user if not exist
if ! id "$user" &>/dev/null; then
# get the user name
@ -41,6 +32,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# update the user-group ID
usermod -o -u "$group" "$USER_NAME"
fi
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$uid"
group="$gid"
fi
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$JOOMLA_DB_HOST" ]; then