-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateall.sh
More file actions
executable file
·53 lines (47 loc) · 1.71 KB
/
updateall.sh
File metadata and controls
executable file
·53 lines (47 loc) · 1.71 KB
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
#!/bin/bash
source "$HOME/HeroiCraft/scripts/sourceme" || exit 4 # Exit if sourceme isn't found
echo "Pass the -u argument to update spigot / bungee / waterfall / paper"
function main {
for server in $serverList; do
echo "Updating $server"
if [[ $server != bungee ]]; then
cp -arfv "$HeroiCraftDIR/copyToAll/." "$HeroiCraftDIR/$server"
fi
rsync -ravz --update --existing $HeroiCraftDIR/copyToSome/ $HeroiCraftDIR/$server
done
rm -rf "$HeroiCraftDIR/copyToAll/"
rm -rf "$HeroiCraftDIR/copyToSome/"
mkdir -p "$HeroiCraftDIR/copyToAll/plugins/"
mkdir -p "$HeroiCraftDIR/copyToSome/plugins/"
cd "$HeroiCraftDIR"
if [[ "$@" == "-u" ]]; then
echo "Updating all Servers to latest version..."
updateBungee
updateSpigot
fi
}
function updateBungee {
echo "Updating $bungeeType"
cd "$HeroiCraftDIR/bungee"
if [[ "$bungeeType" == "waterfall" ]]; then
wget -N -t 1 "https://papermc.io/ci/job/Waterfall/lastStableBuild/artifact/Waterfall-Proxy/bootstrap/target/Waterfall.jar" -O waterfall.jar
elif [[ "$bungeeType" == "bungeecord" ]]; then
wget -N -t 1 http://ci.md-5.net/job/BungeeCord/lastStableBuild/artifact/bootstrap/target/BungeeCord.jar -O bungeecord.jar
else
echo "Unknown BungeeCord type: $bungeeType"
fi
cd ..
}
function updateSpigot {
if [[ "$spigotType" == "spigot" ]]; then
cd "$HeroiCraftDIR/BuildTools"
wget -N -t 1 https://hub.spigotmc.org/jenkins/job/BuildTools/lastStableBuild/artifact/target/BuildTools.jar
$HeroiCraftDIR/scripts/buildSpigot.sh
elif [[ "$spigotType" == "paper" ]]; then
echo "This must be done manually for now"
echo "Place the paperclip jar in the CopyToAll folder and it should update"
else
echo "Unknown Spigot type: $spigotType"
fi
}
main "$@"