forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-list-web-domain-errorlog
executable file
·48 lines (35 loc) · 1.28 KB
/
v-list-web-domain-errorlog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# info: list web domain error log
# options: USER DOMAIN [LINES]
#
# The function of obtaining raw error web domain logs.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$2
lines=${3-70}
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Check number of output lines
if [ "$lines" -gt '3000' ]; then
read_cmd="cat"
else
read_cmd="tail -n $lines"
fi
$read_cmd /var/log/$WEB_SYSTEM/domains/$domain.error.log
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit