mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
53
bin/v-suspend-mail-accounts
Executable file
53
bin/v-suspend-mail-accounts
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
# info: suspend all mail domain accounts
|
||||
# options: user domain
|
||||
#
|
||||
# The function suspends all mail domain accounts.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
domain=$(idn -t --quiet -u "$2" )
|
||||
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
|
||||
domain_idn=$(idn -t --quiet -a "$domain")
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user domain'
|
||||
validate_format 'user' 'domain'
|
||||
is_system_enabled "$MAIL_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'mail' 'DOMAIN' "$domain"
|
||||
is_object_unsuspended 'mail' 'DOMAIN' "$domain"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Starting suspend loop
|
||||
for account in $(search_objects "mail/$domain" 'SUSPENDED' "no" 'ACCOUNT'); do
|
||||
$BIN/v-suspend-mail-account "$user" "$domain" "$account"
|
||||
done
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# No Logging
|
||||
#log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue