yunohost/data/apps/helpers.d/user
2015-11-30 18:35:41 +01:00

15 lines
420 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Check if a user exists
#
# usage: ynh_user_exists username
# | ret: retcode - 0 if user exists, 1 otherwise
ynh_user_exists() {
sudo yunohost user list --output-as json | grep -q "\"username\": \"${1}\""
}
# Retrieve a user information
#
# usage: ynh_user_info username key
# | ret: string - the key's value
ynh_user_get_info() {
sudo yunohost user info "${1}" --output-as plain | ynh_get_plain_key "${2}"
}