2015-04-24 08:07:18 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-02-05 00:43:27 +01:00
|
|
|
# Move to the Etherpad base directory.
|
|
|
|
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
|
2024-02-21 21:50:11 +01:00
|
|
|
cd "${MY_DIR}/.." || exit 1
|
2020-10-06 14:28:11 +02:00
|
|
|
|
2021-02-03 00:30:07 +01:00
|
|
|
# Source constants and useful functions
|
2024-02-21 21:50:11 +01:00
|
|
|
. bin/functions.sh
|
2015-04-24 08:07:18 +02:00
|
|
|
|
|
|
|
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
|
2024-02-21 21:50:11 +01:00
|
|
|
bin/installDeps.sh "$@" || exit 1
|
2015-04-24 08:07:18 +02:00
|
|
|
|
|
|
|
#Move to the node folder and start
|
2021-02-16 07:38:04 +01:00
|
|
|
echo "Starting Etherpad..."
|
2024-02-17 16:21:16 +01:00
|
|
|
cd src
|
|
|
|
exec node --import tsx ./node/server.ts "$@"
|