mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add a ynh_user_list helper
This commit is contained in:
parent
704151f5eb
commit
dea0c16540
1 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,17 @@ ynh_user_get_info() {
|
||||||
sudo yunohost user info "$1" --output-as plain | ynh_get_plain_key "$2"
|
sudo yunohost user info "$1" --output-as plain | ynh_get_plain_key "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get the list of YunoHost users
|
||||||
|
#
|
||||||
|
# example: for u in $(ynh_user_list); do ...
|
||||||
|
#
|
||||||
|
# usage: ynh_user_list
|
||||||
|
# | ret: string - one username per line
|
||||||
|
ynh_user_list() {
|
||||||
|
sudo yunohost user list --output-as plain --quiet \
|
||||||
|
| awk '/^##username$/{getline; print}'
|
||||||
|
}
|
||||||
|
|
||||||
# Check if a user exists on the system
|
# Check if a user exists on the system
|
||||||
#
|
#
|
||||||
# usage: ynh_system_user_exists username
|
# usage: ynh_system_user_exists username
|
||||||
|
|
Loading…
Add table
Reference in a new issue