mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
dox2unix fix after merge
This commit is contained in:
parent
6e0aba66e0
commit
b8b28120fd
231 changed files with 20776 additions and 20776 deletions
|
@ -1,65 +1,65 @@
|
|||
#!/bin/bash
|
||||
# info: list system users
|
||||
# options: [FORMAT]
|
||||
#
|
||||
# The function for obtaining the list of system users without
|
||||
# detailed information.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
format=${1-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Json function
|
||||
json_list_users() {
|
||||
users=$(grep @ /etc/passwd|cut -f 1 -d :)
|
||||
int_counter=$(echo "$users" | wc -l)
|
||||
i=1
|
||||
echo '['
|
||||
for user in $users; do
|
||||
if [ "$i" -lt "$int_counter" ]; then
|
||||
echo -e "\t\"$user\","
|
||||
else
|
||||
echo -e "\t\"$user\""
|
||||
fi
|
||||
(( ++i))
|
||||
done
|
||||
echo "]"
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_users() {
|
||||
if [ -z "$nohead" ]; then
|
||||
echo "USERS"
|
||||
echo "----------"
|
||||
fi
|
||||
for user in $(grep @ /etc/passwd|cut -f 1 -d :); do
|
||||
echo "$user"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list_users ;;
|
||||
plain) nohead=1; shell_list_users ;;
|
||||
shell) shell_list_users ;;
|
||||
*) check_args '1' '0' '[FORMAT]' ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: list system users
|
||||
# options: [FORMAT]
|
||||
#
|
||||
# The function for obtaining the list of system users without
|
||||
# detailed information.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
format=${1-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Json function
|
||||
json_list_users() {
|
||||
users=$(grep @ /etc/passwd|cut -f 1 -d :)
|
||||
int_counter=$(echo "$users" | wc -l)
|
||||
i=1
|
||||
echo '['
|
||||
for user in $users; do
|
||||
if [ "$i" -lt "$int_counter" ]; then
|
||||
echo -e "\t\"$user\","
|
||||
else
|
||||
echo -e "\t\"$user\""
|
||||
fi
|
||||
(( ++i))
|
||||
done
|
||||
echo "]"
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_users() {
|
||||
if [ -z "$nohead" ]; then
|
||||
echo "USERS"
|
||||
echo "----------"
|
||||
fi
|
||||
for user in $(grep @ /etc/passwd|cut -f 1 -d :); do
|
||||
echo "$user"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list_users ;;
|
||||
plain) nohead=1; shell_list_users ;;
|
||||
shell) shell_list_users ;;
|
||||
*) check_args '1' '0' '[FORMAT]' ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue