mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
bin: Use consistent comment formatting
This commit is contained in:
parent
be1f2152fc
commit
8e8b75be6c
5 changed files with 38 additions and 38 deletions
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
#This script ensures that ep-lite is automatically restarting after an error happens
|
||||
# This script ensures that ep-lite is automatically restarting after
|
||||
# an error happens
|
||||
|
||||
#Handling Errors
|
||||
# 0 silent
|
||||
# 1 email
|
||||
# Handling Errors
|
||||
# 0 silent
|
||||
# 1 email
|
||||
ERROR_HANDLING=0
|
||||
# Your email address which should receive the error messages
|
||||
EMAIL_ADDRESS="no-reply@example.com"
|
||||
|
@ -18,15 +19,15 @@ TIME_BETWEEN_EMAILS=600 # 10 minutes
|
|||
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)
|
||||
|
||||
#Was this script started in the bin folder? if yes move out
|
||||
# Was this script started in the bin folder? if yes move out
|
||||
if [ -d "../bin" ]; then
|
||||
cd "../"
|
||||
fi
|
||||
|
||||
#Check if a logfile parameter is set
|
||||
# Check if a logfile parameter is set
|
||||
if [ -z "${LOG}" ]; then
|
||||
echo "Set a logfile as the first parameter"
|
||||
exit 1
|
||||
|
@ -35,21 +36,21 @@ fi
|
|||
shift
|
||||
while [ 1 ]
|
||||
do
|
||||
#Try to touch the file if it doesn't exist
|
||||
# Try to touch the file if it doesn't exist
|
||||
if [ ! -f ${LOG} ]; then
|
||||
touch ${LOG} || ( echo "Logfile '${LOG}' is not writeable" && exit 1 )
|
||||
fi
|
||||
|
||||
#Check if the file is writeable
|
||||
# Check if the file is writeable
|
||||
if [ ! -w ${LOG} ]; then
|
||||
echo "Logfile '${LOG}' is not writeable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Start the application
|
||||
# Start the application
|
||||
bin/run.sh $@ >>${LOG} 2>>${LOG}
|
||||
|
||||
#Send email
|
||||
# Send email
|
||||
if [ $ERROR_HANDLING = 1 ]; then
|
||||
TIME_NOW=$(date +%s)
|
||||
TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))
|
||||
|
@ -63,6 +64,6 @@ do
|
|||
|
||||
echo "RESTART!" >>${LOG}
|
||||
|
||||
#Sleep 10 seconds before restart
|
||||
# Sleep 10 seconds before restart
|
||||
sleep 10
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue