Adds SCRIPT_DIR to replace relative paths for conf, db, etc.

main
Yasen Pramatarov 2024-06-04 20:38:00 +03:00
parent 329fc10ff0
commit d558096288
3 changed files with 11 additions and 7 deletions

6
jilo
View File

@ -6,8 +6,10 @@
# Bash script for Jitsi Meet components (Videobridge, Jicofo, etc.) logs parsing
###
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" #"
### Configuration file (overrides default configs)
CONFIG_FILE="./jilo.conf"
CONFIG_FILE="$SCRIPT_DIR/jilo.conf"
### Default configuration
@ -19,7 +21,7 @@ DEFAULT_JICOFO_PROCESS="jicofo"
# Default database type (sqlite, mysql|mariadb)
DEFAULT_DB_TYPE="sqlite"
# Default SQLite database file
DEFAULT_DB="./jilo.db"
DEFAULT_DB="$SCRIPT_DIR/jilo.db"
# Default MySQL/MariaDB configuration
DEFAULT_MYSQL_HOST="localhost"
DEFAULT_MYSQL_USER="jilo"

View File

@ -7,15 +7,17 @@
# Command line interface (jilo-cli)
###
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" #"
### Configuration file (overrides default configs)
CONFIG_FILE="./jilo.conf"
CONFIG_FILE="$SCRIPT_DIR/jilo.conf"
### Default configuration
# Default database type (sqlite, mysql|mariadb)
DEFAULT_DB_TYPE="sqlite"
# Default SQLite database file
DEFAULT_DB="./jilo.db"
DEFAULT_DB="$SCRIPT_DIR/jilo.db"
# Default MySQL/MariaDB configuration
DEFAULT_MYSQL_HOST="localhost"
DEFAULT_MYSQL_USER="jilo"
@ -265,8 +267,8 @@ case "$cmd" in
if [[ "$time_range_specified" == true ]]; then
db_stats_conferences_time=$(printf "$db_stats_conferences_time_template" "$from_time" "$until_time")
db_query "$db_stats_conferences_time"
fi
exit 0
fi
;;
*)

View File

@ -3,5 +3,5 @@
# the values here override the default ones in JILO
###
JVB_LOGFILE="./jvb.log"
JICOFO_LOGFILE="./jicofo.log"
JVB_LOGFILE="$SCRIPT_DIR/jvb.log"
JICOFO_LOGFILE="$SCRIPT_DIR/jicofo.log"