-
Notifications
You must be signed in to change notification settings - Fork 0
/
minecraft.sh
executable file
·56 lines (48 loc) · 1.37 KB
/
minecraft.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
#!/bin/bash
if [[ "$EUID" = 0 ]]; then
echo "> already root"
else
sudo -k # make sure to ask for password on next sudo
if sudo true; then
echo "> correct password"
else
echo "> wrong password"
exit 1
fi
fi
# Do your sudo stuff here. Password will not be asked again due to caching.
# Minecraft
echo "> installing java ..."
sudo apt-get -y install default-jre \
openjdk-8-jre \
openjdk-11-jre \
openjdk-17-jre \
>/dev/null 2>&1
echo " ... done"
echo ""
echo "> downloading minecraft launcher"
echo ""
curl 'https://launcher.mojang.com/download/Minecraft.deb' \
--compressed --output $HOME/Downloads/Minecraft.deb
echo "> installing minecraft ..."
sudo dpkg -i /tmp/Minecraft.deb >/dev/null 2>&1
rm $HOME/Downloads/Minecraft.deb
minecraft-launcher >/dev/null 2>&1
echo " ... done"
# Minecraft Starterdatei
echo '[Desktop Entry]
Type=Application
Version=1.1
Name=cloudTank Launcher
Comment=cloudTanks Minecraft Launcher
Exec=gamemoderun mangohud --dlsym minecraft-launcher
Icon=minecraft-launcher
Terminal=false
Categories=Game;Application;
StartupWMClass=minecraft-launch' > $HOME/.local/share/applications/minecraft-cloudtank.desktop
# Minecraft cloudTank
cd $HOME/codes/cloudTank/cloudTank-tools
chmod +x updateclient.sh
echo "> installing cloudTank launcher"
sudo apt-get -y install gamemode mangohud
./updateclient.sh