Compare commits

..

No commits in common. "c9b20d98269ee6332064906df67dcde88a611e9e" and "07826b59cf43e8dd270723f603712e4a310fdb61" have entirely different histories.

4 changed files with 6 additions and 36 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
*.log
*.log.*
jitsi-stats.db
jilo.db

View File

@ -1,4 +0,0 @@
# jilo.conf - configuration variables for JItso Log Observer
LOGFILE="./jvb.log"
ROTATED_LOGFILE="./jvb.log.1"
DB="./jilo.db"

View File

View File

@ -1,25 +1,12 @@
#!/usr/bin/env bash
### Default configuration
### Variables
# default log files
DEFAULT_LOGFILE="./jvb.log"
DEFAULT_ROTATED_LOGFILE="./jvb.log.1"
# Default SQLite database file
DEFAULT_DB="./jitsi-stats.db"
# Configuration file
CONFIG_FILE="./jilo.conf"
# Load configurations from the config file if it exists
if [[ -f "$CONFIG_FILE" ]]; then
source "$CONFIG_FILE"
fi
# use default values if not overriden by config file
LOGFILE=${LOGFILE:-$DEFAULT_LOGFILE}
ROTATED_LOGFILE=${ROTATED_LOGFILE:-$DEFAULT_ROTATED_LOGFILE}
DB=${DB:-$DEFAULT_DB}
# log files
LOGFILE="./jvb.log"
ROTATED_LOGFILE="./jvb.log.1"
# SQLite database file
DB="./jitsi-stats.db"
###
@ -200,18 +187,6 @@ case "$cmd" in
--check)
# First check if database exists
if [[ ! -f $"DB" ]]; then
echo "Database not found. If it's a fresh install, please install the database first."
exit 1
fi
# Check the state table
if ! sqlite3 "$DB" ".schema state" &>/dev/null; then
echo "The database doesn't contain the required table \"state\". Please check it, and if needed, reinstall it."
exit 1
fi
# Retrieve last log file and position inside it
IFS='|' read -r last_file last_filetime last_size last_pos last_inode <<< $(get_state)