summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-06-04 15:57:39 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-06-04 15:57:39 +0100
commit43712c4cefd070a88b56f2530e53eed036bfcdc9 (patch)
tree2baf3b02ff5831cb087adb72ec32b75e30b95e4c /bin
parent4e0cf8a0c3db77961fa7bdd39e3defdf65f0d223 (diff)
downloadetherpad-lite-43712c4cefd070a88b56f2530e53eed036bfcdc9.zip
run.sh is startable from any location again
Diffstat (limited to 'bin')
-rwxr-xr-xbin/run.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/run.sh b/bin/run.sh
index 04d5317b..b83f1057 100755
--- a/bin/run.sh
+++ b/bin/run.sh
@@ -1,5 +1,14 @@
#!/bin/bash
+#Move to the folder where ep-lite is installed
+FOLDER=$(dirname $(readlink -f $0))
+cd $FOLDER
+
+#Was this script started in the bin folder? if yes move out
+if [ -d "../bin" ]; then
+ cd "../"
+fi
+
#Stop the script if its started as root
if [[ $EUID -eq 0 ]]; then
echo "You shouldn't start Etherpad-Lite as root!" 1>&2
@@ -19,11 +28,6 @@ type -P npm &>/dev/null || {
exit 1
}
-#Was this script started in the bin folder? if yes move out
-if [ -d "../bin" ]; then
- cd "../"
-fi
-
#Does a settings.json exist? if no copy the template
if [ ! -f "settings.json" ]; then
echo "Copy the settings template to settings.json..."