diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/debugRun.sh | 4 | ||||
-rwxr-xr-x | bin/generateJsDoc.sh | 6 | ||||
-rwxr-xr-x | bin/run.sh | 12 | ||||
-rwxr-xr-x | bin/safeRun.sh | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/bin/debugRun.sh b/bin/debugRun.sh index 8e1d737e..014d11cd 100755 --- a/bin/debugRun.sh +++ b/bin/debugRun.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -type -P node-inspector &>/dev/null || { +hash node-inspector > /dev/null 2>&1 || { echo "You need to install node-inspector to run the tests!" >&2 echo "You can install it with npm" >&2 echo "Run: npm install -g node-inspector" >&2 diff --git a/bin/generateJsDoc.sh b/bin/generateJsDoc.sh index c9424b74..cf876278 100755 --- a/bin/generateJsDoc.sh +++ b/bin/generateJsDoc.sh @@ -1,15 +1,15 @@ -#!/bin/bash +#!/bin/sh if [ -d "../bin" ]; then cd "../" fi -type -P node &>/dev/null || { +hash node > /dev/null 2>&1 || { echo "You need to install node!" >&2 exit 1 } -type -P doc.md &>/dev/null || { +hash doc.md > /dev/null 2>&1 || { echo "You need to install doc.md! npm install -g doc.md" >&2 exit 1 } @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #Move to the folder where ep-lite is installed FOLDER=$(dirname $(readlink -f $0)) @@ -10,20 +10,20 @@ if [ -d "../bin" ]; then fi #Stop the script if its started as root -if [[ $EUID -eq 0 ]]; then +if [ "$(id -u)" -eq 0 ]; then echo "You shouldn't start Etherpad-Lite as root!" 1>&2 echo "Use authbind if you want to use a port lower than 1024 -> http://en.wikipedia.org/wiki/Authbind" 1>&2 exit 1 fi #Is node installed? -type -P node &>/dev/null || { +hash node > /dev/null 2>&1 || { echo "You need to install node to run Etherpad-Lite!" >&2 exit 1 } #Is npm installed? -type -P npm &>/dev/null || { +hash npm > /dev/null 2>&1 || { echo "You need to install npm to run Etherpad-Lite!" >&2 exit 1 } @@ -43,12 +43,12 @@ NEEDED_VERSION="1.6.2" if [ -f "static/js/jquery.min.js" ]; then VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*"); - if [[ ${VERSION:1} = $NEEDED_VERSION ]]; then + if [ ${VERSION#v} = $NEEDED_VERSION ]; then DOWNLOAD_JQUERY="false" fi fi -if [[ $DOWNLOAD_JQUERY = "true" ]]; then +if [ $DOWNLOAD_JQUERY = "true" ]; then wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js fi diff --git a/bin/safeRun.sh b/bin/safeRun.sh index 180de1fe..d7d2b99c 100755 --- a/bin/safeRun.sh +++ b/bin/safeRun.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #This script ensures that ep-lite is automatically restarting after an error happens @@ -49,12 +49,12 @@ do bin/run.sh >>$1 2>>$1 #Send email - if [ $ERROR_HANDLING == 1 ]; then + if [ $ERROR_HANDLING = 1 ]; then TIME_NOW=$(date +%s) TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND)) if [ $TIME_SINCE_LAST_SEND -gt $TIME_BETWEEN_EMAILS ]; then - echo -e "Server was restared at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 $1)" | mail -s "Pad Server was restarted" $EMAIL_ADDRESS + printf "Server was restared at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 $1)" | mail -s "Pad Server was restarted" $EMAIL_ADDRESS LAST_EMAIL_SEND=$TIME_NOW fi |