aboutsummaryrefslogtreecommitdiff
path: root/init.sh
blob: 2fc915d30e42468c4b3c5e76da7316e85f1e77ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
exec 1>>/tmp/slogs
exec 2>>/tmp/slogs
echo "========"
echo | date
echo "# Init running"

echo "# Waiting for connection..."
while ! ping 'example.org' -c 1; do
        sleep 5
done
echo "# Connected to internet!"

echo ""

echo "# Testing DB availability"
while ! echo 'exit' | mysql; do
	sleep 5
done
echo "# Database seems to be available (ignore error messages above)"

echo ""

cd "$BASE_DIR/LYLLRuoka"
echo "# node server.js:"
node server.js

echo "========"
echo ""
echo ""