Adds default variables and a config file.
parent
07826b59cf
commit
24de1dbf82
|
@ -0,0 +1,4 @@
|
||||||
|
# jilo.conf - configuration variables for JItso Log Observer
|
||||||
|
LOGFILE="./jvb.log"
|
||||||
|
ROTATED_LOGFILE="./jvb.log.1"
|
||||||
|
DB="./jilo.db"
|
|
@ -1,12 +1,25 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
### Variables
|
### Default configuration
|
||||||
|
|
||||||
# log files
|
# default log files
|
||||||
LOGFILE="./jvb.log"
|
DEFAULT_LOGFILE="./jvb.log"
|
||||||
ROTATED_LOGFILE="./jvb.log.1"
|
DEFAULT_ROTATED_LOGFILE="./jvb.log.1"
|
||||||
# SQLite database file
|
# Default SQLite database file
|
||||||
DB="./jitsi-stats.db"
|
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}
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue