2015-04-24 08:07:18 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-10-06 14:28:11 +02:00
|
|
|
# Move to the folder where ep-lite is installed
|
|
|
|
cd "$(dirname "$0")"/..
|
|
|
|
|
|
|
|
# Source constants and usefull functions
|
|
|
|
. bin/functions.sh
|
2015-04-24 08:07:18 +02:00
|
|
|
|
|
|
|
#Was this script started in the bin folder? if yes move out
|
|
|
|
if [ -d "../bin" ]; then
|
|
|
|
cd "../"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ignoreRoot=0
|
2019-12-01 01:52:32 +01:00
|
|
|
for ARG in "$@"
|
2015-04-24 08:07:18 +02:00
|
|
|
do
|
|
|
|
if [ "$ARG" = "--root" ]; then
|
|
|
|
ignoreRoot=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2017-09-14 13:33:27 +02:00
|
|
|
#Stop the script if it's started as root
|
2015-04-24 08:07:18 +02:00
|
|
|
if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then
|
|
|
|
echo "You shouldn't start Etherpad as root!"
|
|
|
|
echo "Please type 'Etherpad rocks my socks' or supply the '--root' argument if you still want to start it as root"
|
|
|
|
read rocks
|
|
|
|
if [ ! $rocks = "Etherpad rocks my socks" ]
|
|
|
|
then
|
|
|
|
echo "Your input was incorrect"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#Clean the current environment
|
|
|
|
rm -rf src/node_modules
|
|
|
|
|
2017-09-14 13:33:27 +02:00
|
|
|
#Prepare the environment
|
2019-12-01 01:52:32 +01:00
|
|
|
bin/installDeps.sh "$@" || exit 1
|
2015-04-24 08:07:18 +02:00
|
|
|
|
|
|
|
#Move to the node folder and start
|
|
|
|
echo "Started Etherpad..."
|
|
|
|
|
2020-03-29 00:53:17 +01:00
|
|
|
SCRIPTPATH=$(pwd -P)
|
2020-10-06 14:28:11 +02:00
|
|
|
node $(compute_node_args) "${SCRIPTPATH}/node_modules/ep_etherpad-lite/node/server.js" "$@"
|