mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
15 lines
400 B
Text
15 lines
400 B
Text
# 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}"
|
||
}
|