yunohost/data/apps/helpers.d/user
2015-09-29 18:45:07 +02:00

15 lines
400 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 --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}" --plain | ynh_get_plain_key "${2}"
}