mirror of
https://github.com/myvesta/vesta
synced 2025-07-14 17:13:23 -07:00
added web-log viewer
This commit is contained in:
parent
f789b7fc91
commit
78d963eaee
12 changed files with 302 additions and 1 deletions
49
bin/v-list-web-domain-errorlog
Executable file
49
bin/v-list-web-domain-errorlog
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/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-30}
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue