mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-02-03 16:43:09 -08:00
49 lines
1.3 KiB
Bash
Executable File
49 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: list web domain access log
|
|
# options: USER DOMAIN [LINES]
|
|
#
|
|
# The function of obtaining raw access 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.log
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
exit
|