forked from SuperMarcus/MineDoor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
55 lines (36 loc) · 1.37 KB
/
build.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
#!/bin/bash
echo "[*] MineDoor - By Marcus (https://github.com/SuperMarcus)"
DIR="$(pwd)"
date > "$DIR/install.log" 2>&1
uname -a >> "$DIR/install.log" 2>&1
echo "[*] Checking dependecies..."
type mvn >> "$DIR/install.log" 2>&1 || { echo >&2 "[!] Please install \"mvn\""; read -p "Press [Enter] to continue..."; exit 1; }
type git >> "$DIR/install.log" 2>&1 || { echo >&2 "[!] Please install \"git\""; read -p "Press [Enter] to continue..."; exit 1; }
shopt -s expand_aliases
type wget >> "$DIR/install.log" 2>&1
if [ $? -eq 0 ]; then
alias download_file="wget --no-check-certificate -q -O -"
else
type curl >> "$DIR/install.log" 2>&1
if [ $? -eq 0 ]; then
alias download_file="curl --insecure --silent --location"
else
echo "error, curl or wget not found"
fi
fi
echo "[*] Downloading latest git checkout..."
git clone --recursive "https://github.com/SuperMarcus/MineDoor.git" >> "$DIR/install.log" 2>&1
cd MineDoor
echo "[*] Compiling..."
mvn package >> "$DIR/install.log" 2>&1
echo "[*] Copying dependencies..."
mvn dependency:copy-dependencies >> "$DIR/install.log" 2>&1
echo "[*] Copying files..."
cp -ri build/* ../
cd ..
echo "[*] Downloading \"start.sh\"..."
download_file "https://raw.githubusercontent.com/SuperMarcus/MineDoor/master/start.sh" > start.sh
chmod 777 start.sh
echo "[*] Cleaning..."
rm -rf MineDoor
echo "[*] Done! Run \"./start.sh\" to start MineDoor."