mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
bin: Put log parameter handling logic together
This commit is contained in:
parent
335705e03d
commit
ab408ce653
1 changed files with 2 additions and 2 deletions
|
@ -22,15 +22,15 @@ error() { log "ERROR: $@" >&2; }
|
||||||
fatal() { error "$@"; exit 1; }
|
fatal() { error "$@"; exit 1; }
|
||||||
|
|
||||||
LAST_EMAIL_SEND=0
|
LAST_EMAIL_SEND=0
|
||||||
LOG="$1"
|
|
||||||
|
|
||||||
# Move to the folder where ep-lite is installed
|
# Move to the folder where ep-lite is installed
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
# Check if a logfile parameter is set
|
# Check if a logfile parameter is set
|
||||||
|
LOG="$1"
|
||||||
[ -n "${LOG}" ] || fatal "Set a logfile as the first parameter"
|
[ -n "${LOG}" ] || fatal "Set a logfile as the first parameter"
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
# Try to touch the file if it doesn't exist
|
# Try to touch the file if it doesn't exist
|
||||||
[ -f "${LOG}" ] || touch "${LOG}" || fatal "Logfile '${LOG}' is not writeable"
|
[ -f "${LOG}" ] || touch "${LOG}" || fatal "Logfile '${LOG}' is not writeable"
|
||||||
|
|
Loading…
Reference in a new issue