mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
66
bin/v-list-web-stats
Executable file
66
bin/v-list-web-stats
Executable file
|
@ -0,0 +1,66 @@
|
|||
#!/bin/bash
|
||||
# info: list web statistics
|
||||
# options: [format]
|
||||
#
|
||||
# The function for obtaining the list of web statistics analyzer.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
format=${1-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
||||
# Json function
|
||||
json_list_st() {
|
||||
stats=$(echo "${STATS_SYSTEM//,/ } none")
|
||||
st_counter=$(echo "$stats" | wc -w)
|
||||
i=1
|
||||
echo '['
|
||||
for st in $stats; do
|
||||
if [ "$i" -lt "$st_counter" ]; then
|
||||
echo -e "\t\"$st\","
|
||||
else
|
||||
echo -e "\t\"$st\""
|
||||
fi
|
||||
(( ++i))
|
||||
done
|
||||
echo "]"
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_st() {
|
||||
stats=$(echo "none ${STATS_SYSTEM//,/ }")
|
||||
if [ -z "$nohead" ]; then
|
||||
echo "STATS"
|
||||
echo "----------"
|
||||
fi
|
||||
for st in $stats; do
|
||||
echo "$st"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list_st ;;
|
||||
plain) nohead=1; shell_list_st ;;
|
||||
shell) shell_list_st ;;
|
||||
*) check_args '1' '0' '[format]' ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue