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,72 +1,72 @@
|
|||
#!/bin/bash
|
||||
# info: list mail account autoreply
|
||||
# options: USER DOMAIN ACCOUNT [FORMAT]
|
||||
#
|
||||
# The function of obtainin mail account autoreply message.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
domain=$2
|
||||
account=$3
|
||||
format=${4-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Json function
|
||||
json_list_msg() {
|
||||
i='1' # iterator
|
||||
echo '{'
|
||||
echo -e "\t\"$account\": {"
|
||||
echo " \"MSG\": \"$msg\""
|
||||
echo -e "\t}\n}"
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_msg() {
|
||||
if [ ! -z "$msg" ]; then
|
||||
echo -e "$msg"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_valid 'mail' 'DOMAIN' "$domain"
|
||||
is_object_unsuspended 'mail' 'DOMAIN' "$domain"
|
||||
is_object_valid "mail/$domain" 'ACCOUNT' "$account"
|
||||
is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
if [ -e "$USER_DATA/mail/$account@$domain.msg" ]; then
|
||||
msg=$(cat $USER_DATA/mail/$account@$domain.msg |\
|
||||
sed -e ':a;N;$!ba;s/\n/\\n/g' )
|
||||
fi
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list_msg ;;
|
||||
plain) nohead=1; shell_list_msg ;;
|
||||
shell) shell_list_msg ;;
|
||||
*) check_args '1' '0' '[FORMAT]'
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: list mail account autoreply
|
||||
# options: USER DOMAIN ACCOUNT [FORMAT]
|
||||
#
|
||||
# The function of obtainin mail account autoreply message.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
domain=$2
|
||||
account=$3
|
||||
format=${4-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Json function
|
||||
json_list_msg() {
|
||||
i='1' # iterator
|
||||
echo '{'
|
||||
echo -e "\t\"$account\": {"
|
||||
echo " \"MSG\": \"$msg\""
|
||||
echo -e "\t}\n}"
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_msg() {
|
||||
if [ ! -z "$msg" ]; then
|
||||
echo -e "$msg"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_valid 'mail' 'DOMAIN' "$domain"
|
||||
is_object_unsuspended 'mail' 'DOMAIN' "$domain"
|
||||
is_object_valid "mail/$domain" 'ACCOUNT' "$account"
|
||||
is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
if [ -e "$USER_DATA/mail/$account@$domain.msg" ]; then
|
||||
msg=$(cat $USER_DATA/mail/$account@$domain.msg |\
|
||||
sed -e ':a;N;$!ba;s/\n/\\n/g' )
|
||||
fi
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list_msg ;;
|
||||
plain) nohead=1; shell_list_msg ;;
|
||||
shell) shell_list_msg ;;
|
||||
*) check_args '1' '0' '[FORMAT]'
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue