optimized domain function usage

This commit is contained in:
Serghey Rodin 2012-02-29 15:18:01 +02:00
commit b4775368cb
3 changed files with 10 additions and 35 deletions

View file

@ -40,7 +40,7 @@ is_domain_suspended() {
# Checking result
if [ ! -z "$check_domain" ]; then
echo "Error: domain suspended"
echo "Error: domain $domain is suspended"
log_event 'debug' "$E_SUSPENDED $V_EVENT"
exit $E_SUSPENDED
fi
@ -409,34 +409,6 @@ del_web_config() {
sed -i "$top_line,$bottom_line d" $conf
}
del_dns_domain() {
conf="$V_USERS/$user/dns.conf"
# Parsing domains
string=$( grep -n "DOMAIN='$domain'" $conf | cut -f 1 -d : )
if [ -z "$string" ]; then
echo "Error: parse error"
log_event 'debug' "$E_PARSING $V_EVENT"
exit $E_PARSING
fi
sed -i "$string d" $conf
rm -f $V_USERS/$user/dns/$domain
}
del_web_domain() {
conf="$V_USERS/$user/web.conf"
# Parsing domains
string=$( grep -n "DOMAIN='$domain'" $conf | cut -f 1 -d : )
if [ -z "$string" ]; then
echo "Error: parse error"
log_event 'debug' "$E_PARSING $V_EVENT"
exit $E_PARSING
fi
sed -i "$string d" $conf
}
dom_clear_search(){
# Defining delimeter
IFS=$'\n'