-
Notifications
You must be signed in to change notification settings - Fork 105
/
linux-start.sh
executable file
·69 lines (51 loc) · 1.4 KB
/
linux-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
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
63
64
65
66
67
68
#!/bin/bash
welcome() {
echo ""
echo "Welcome to AvaIre's Linux launcher"
echo "Please select an option to begin:"
echo ""
echo " 1. Start the bot normally"
echo " 2. Start the bot with automatic restarts"
echo " 3. Update the bot using the nightly build"
echo " 9. Exit program"
echo ""
echo "Enter your option: "
read option
if [ 1 -eq $option ]; then
echo "Nornal start has been selected, starting the bot..."
echo ""
startApplication
elif [ 2 -eq $option ]; then
echo "Starting the bot with automatic restarts..."
echo ""
startLoop
elif [ 3 -eq $option ]; then
echo "Updating using the nightly build..."
echo ""
updateWithNightlyBuild
fi
}
startLoop() {
while true; do
startApplication false
echo ""
echo "Restarting the application in 5 seconds!"
echo "If you want to cancel the process, you can use CTRL + C now"
sleep 5
done
}
startApplication() {
java -jar AvaIre.jar
if [ "$1" != "false" ]; then
welcome
fi
}
updateWithNightlyBuild() {
echo "Downloading the latest version..."
curl -sS https://avairebot.com/nightly-build.jar --output nightly-build.jar
echo "Replacing jar files with the latest version..."
mv nightly-build.jar AvaIre.jar
echo "Done!"
welcome
}
welcome