-
Notifications
You must be signed in to change notification settings - Fork 5
/
post_update.sh
executable file
·62 lines (49 loc) · 1.62 KB
/
post_update.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
mkdir -p /usr/local/games
mkdir -p /usr/local/etc/rc.d
# Remove previous MineOS install
if [ -d "/usr/local/games/minecraft" ] ; then
rm -rf /usr/local/games/minecraft
fi
# Clone source from official MineOS repository
cd /usr/local/games
git clone https://github.com/hexparrot/mineos-node --quiet --depth 1 minecraft
if [ $? -ne 0 ] ; then
echo "ERROR: Failed to get source from MineOS Repository"
exit 1
fi
cd minecraft
# Create configuration file
if [ ! -f "/etc/mineos.conf" ] ; then
# Option #1: Create standard configuration file
# cp mineos.conf /etc/mineos.conf
# Option #2: use http instead of the standard https
sed 's/^use_https.*/use_https = false/' mineos.conf > /etc/mineos.conf
fi
# Temporary hacks, as workaround for building node-userid
pkg remove -y node npm
pkg install -y node14 npm-node14
npm install jsegaert/node-userid
# Build
echo "CXX=c++ npm install" | sh
# Enable the service
chmod +x *.sh
chmod +x /usr/local/etc/rc.d/mineos
sysrc -f /etc/rc.conf mineos_enable="YES"
# Start the service
service mineos start
service mineos status >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "ERROR: Failed to start service"
exit 1
fi
echo
cat <<EOF > /root/PLUGIN_INFO
#---------------------------------------------------------------------#
# Getting started with the MineOs plugin
#---------------------------------------------------------------------#
MineOS is a server front-end to ease managing Minecraft administrative tasks.
For more information, see https://github.com/hexparrot/mineos-node
The default user for the Admin Portal is "mcserver" with password "mcserver"
EOF
cat /root/PLUGIN_INFO