-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
32 lines (27 loc) · 849 Bytes
/
start.sh
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
31
32
#!/bin/bash
echo "SPT-AKI-Server.Docker by Fcatme"
if [ -d "/opt/srv" ]; then
start=$(date +%s)
echo "Started copying files to your volume/directory.. Please wait."
cp -r /opt/srv/* /opt/server/
rm -r /opt/srv
touch /opt/server/delete_me
end=$(date +%s)
echo "Files copied to your machine in $(($end-$start)) seconds."
echo "Starting the server to generate all the required files"
cd /opt/server
chown $(id -u):$(id -g) ./* -Rf
nohup timeout --preserve-status 25s ./Aki.Server.exe >/dev/null 2>&1
sleep 10
sed -i 's/127.0.0.1/0.0.0.0/g' /opt/server/Aki_Data/Server/configs/http.json
echo "Follow the instructions to proceed!"
exit 0
fi
if [ -e "/opt/server/delete_me" ]; then
echo "Error: Safety file found. Exiting."
echo "Please follow the instructions."
exit 1
fi
cd /opt/server && ./Aki.Server.exe
echo "Exiting."
exit 0