-
Notifications
You must be signed in to change notification settings - Fork 81
/
start.sh
34 lines (27 loc) · 716 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
33
34
#!/bin/bash
config_file="$(dirname "$0")/start-config.properties"
jar_file="$(dirname "$0")/petpet-*.jar"
if [ ! -e "$jar_file" ]; then
echo "Cannot find petpet jar file."
read -n 1 -s -r -p "Press any key to continue..."
exit 1
fi
if [ -e "$config_file" ]; then
read -r user_option < "$config_file"
echo "Start Config: $user_option"
else
read -p "Enter the option (0: WebServer, 1: GoCQ Plugin)[0]: " user_option
user_option="${user_option:-0}"
echo "$user_option" > "$config_file"
fi
if [ "$user_option" = "1" ]; then
args="-gocq"
else
args=""
fi
for jar_file in $(ls -1 "$jar_file"); do
:
done
echo "Running $jar_file"
java -jar -Xms16M "$jar_file" $args
exit 0