-
Notifications
You must be signed in to change notification settings - Fork 10
/
bot.sh
46 lines (45 loc) · 1005 Bytes
/
bot.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
#!/bin/bash
while true
do
java -Djava.util.logging.config.file=logging.properties -jar HappyBot.jar
OUT=$?
if [ ${OUT} -eq 10 ]
then
echo "[HappyBot] [Bash] Grabbing Update from SSH..."
cp -u tmp.jar HappyBot.jar
echo "[HappyBot] [Bash] Update Done."
fi
if [ ${OUT} -eq 20 ]
then
echo "[HappyBot] [Bash] Grabbing Update from Git[dev]..."
{
git clone --single-branch -b dev https://github.com/JRoy/happybot.git
cd happybot/
./gradlew shadowJar
cp build/libs/happybot-all.jar ../HappyBot.jar
cd ..
rm -r happybot/
} &> /dev/null
echo "[HappyBot] [Bash] Update Done."
fi
if [ ${OUT} -eq 25 ]
then
echo "[HappyBot] [Bash] Grabbing Update from Git[master]..."
{
git clone https://github.com/JRoy/happybot.git
cd happybot/
./gradlew shadowJar
cp build/libs/happybot-all.jar ../HappyBot.jar
cd ..
rm -r happybot/
} &> /dev/null
echo "[HappyBot] [Bash] Update Done."
fi
echo "[HappyBot] [Bash] Rebooting in:"
for i in 3 2 1
do
echo "[HappyBot] [Bash] $i..."
sleep 1
done
echo "[HappyBot] [Bash] Rebooting!"
done