mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Merge changes from upstream
I'm a little angry
This commit is contained in:
parent
dcf849263d
commit
2b16d9bd83
254 changed files with 24485 additions and 24094 deletions
55
bin/v-search-domain-owner
Executable file
55
bin/v-search-domain-owner
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# info: search domain owner
|
||||
# options: DOMAIN [TYPE]
|
||||
#
|
||||
# The function that allows to find user objects.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
domain=$(idn -t --quiet -u "$1" )
|
||||
type=${2-any}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'DOMAIN [TYPE]'
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Define conf
|
||||
case $type in
|
||||
web) conf="$VESTA/data/users/*/web.conf" ;;
|
||||
dns) conf="$VESTA/data/users/*/dns.conf" ;;
|
||||
mail) conf="$VESTA/data/users/*/mail.conf" ;;
|
||||
*) conf="$VESTA/data/users/*/*.conf"
|
||||
esac
|
||||
|
||||
|
||||
owner=$(grep "DOMAIN='$domain'" $conf | head -n 1 | cut -f7 -d '/')
|
||||
if [ -z "$owner" ]; then
|
||||
exit $E_NOTEXIST
|
||||
fi
|
||||
|
||||
echo $owner
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
#log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue