mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
bin: Use assertion-style condition checks
This commit is contained in:
parent
5462d2109c
commit
a28b7c7595
3 changed files with 8 additions and 22 deletions
|
@ -33,22 +33,16 @@ if [ -d "../bin" ]; then
|
|||
fi
|
||||
|
||||
# Check if a logfile parameter is set
|
||||
if [ -z "${LOG}" ]; then
|
||||
fatal "Set a logfile as the first parameter"
|
||||
fi
|
||||
[ -n "${LOG}" ] || fatal "Set a logfile as the first parameter"
|
||||
|
||||
shift
|
||||
while [ 1 ]
|
||||
do
|
||||
# Try to touch the file if it doesn't exist
|
||||
if [ ! -f ${LOG} ]; then
|
||||
touch ${LOG} || fatal "Logfile '${LOG}' is not writeable"
|
||||
fi
|
||||
[ -f ${LOG} ] || touch ${LOG} || fatal "Logfile '${LOG}' is not writeable"
|
||||
|
||||
# Check if the file is writeable
|
||||
if [ ! -w ${LOG} ]; then
|
||||
fatal "Logfile '${LOG}' is not writeable"
|
||||
fi
|
||||
[ -w ${LOG} ] || fatal "Logfile '${LOG}' is not writeable"
|
||||
|
||||
# Start the application
|
||||
bin/run.sh $@ >>${LOG} 2>>${LOG}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue