2024-09-09 20:45:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
mkdir -p /home/container/discord_bot /home/container/server
|
|
|
|
cd '/home/container/discord_bot'
|
|
|
|
npm install
|
|
|
|
pm2 start bot.js
|
|
|
|
|
|
|
|
cd /home/container/server
|
2024-09-10 08:30:06 +02:00
|
|
|
echo 'Starting server on port ' "$PORT"
|
|
|
|
|
|
|
|
MODIFIED_STARTUP=`echo ${STARTUP} | perl -pe 's@\{\{(.*?)\}\}@$ENV{$1}@g'`
|
|
|
|
echo "Startup: ${MODIFIED_STARTUP}"
|
|
|
|
eval stdbuf -oL -i0 ${MODIFIED_STARTUP}
|
2024-09-09 20:45:50 +02:00
|
|
|
|
|
|
|
# Using stdbuf to force unbuffered output since server is not directly connected to terminal and is buffering output
|
2024-09-10 08:30:06 +02:00
|
|
|
#stdbuf -oL ./server -port "$PORT"
|