2018-09-03 23:31:52 +02:00
|
|
|
#!/bin/bash
|
2018-10-07 11:27:33 +02:00
|
|
|
|
2020-07-10 19:22:37 +02:00
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
2022-10-06 00:00:31 +02:00
|
|
|
php_dependencies="php$YNH_DEFAULT_PHP_VERSION-zip php$YNH_DEFAULT_PHP_VERSION-mbstring php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-dom php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-xml php$YNH_DEFAULT_PHP_VERSION-ldap"
|
2020-07-10 19:22:37 +02:00
|
|
|
|
2022-10-06 00:00:31 +02:00
|
|
|
# dependencies used by the app (must be on a single line)
|
|
|
|
pkg_dependencies="$php_dependencies"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
2020-07-10 19:22:37 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
2022-03-20 19:38:17 +01:00
|
|
|
|
|
|
|
ynh_system_user_add_group() {
|
|
|
|
# Declare an array to define the options of this helper.
|
|
|
|
local legacy_args=uhs
|
|
|
|
local -A args_array=([u]=username= [g]=groups=)
|
|
|
|
local username
|
|
|
|
local groups
|
|
|
|
|
|
|
|
# Manage arguments with getopts
|
|
|
|
ynh_handle_getopts_args "$@"
|
|
|
|
groups="${groups:-}"
|
|
|
|
|
|
|
|
local group
|
|
|
|
for group in $groups; do
|
|
|
|
usermod -a -G "$group" "$username"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ynh_system_user_del_group() {
|
|
|
|
# Declare an array to define the options of this helper.
|
|
|
|
local legacy_args=uhs
|
|
|
|
local -A args_array=([u]=username= [g]=groups=)
|
|
|
|
local username
|
|
|
|
local groups
|
|
|
|
|
|
|
|
# Manage arguments with getopts
|
|
|
|
ynh_handle_getopts_args "$@"
|
|
|
|
groups="${groups:-}"
|
|
|
|
|
|
|
|
local group
|
|
|
|
for group in $groups; do
|
|
|
|
gpasswd -d "$username" "$group"
|
|
|
|
done
|
|
|
|
}
|