Advertisement
surdaft

Minecraft install shell script

Oct 31st, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. # This file is just so that people can quickly get minecraft set up on an ubuntu machine
  2. # I was playing about
  3. # Not 100% sure if it works on other machines.
  4. # MUST BE RAN BY ROOT OR SUDO (sudo bash file_name.sh)
  5.  
  6. printf "Installing Minecraft\nPlease input your username that will be used for creating file structures. (If you don't know it then it is the name of the folder in /home"
  7. read name
  8. mkdir ~/.minecraft
  9. echo "Created ~/.minecraft"
  10. cd ~/.minecraft
  11. wget "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"
  12. echo "Downloaded launcher from the official website"
  13. echo "cd ~/.minecraft; java -jar Minecraft.jar" >> exec.sh
  14. echo "Created execution script"
  15. sudo chmod +x exec.sh Minecraft.jar
  16. echo "Execution script executeable"
  17. wget "http://fc06.deviantart.net/fs70/f/2010/325/1/8/minecraft_icon_by_dharmainitiative2010-d33ca5p.png" -O "icon.png"
  18. echo "Downloading icon"
  19. sudo printf "[Desktop Entry]\nName=Minecraft\nComment=Play Minecraft\nKeywords=game;mine;minecraft;craft;\nExec=/home/$name/.minecraft/exec.sh\nTerminal=false\nType=Application\nStartupNotify=true\nIcon=/home/$name/.minecraft/icon.png\nCategories=Game;" >> ~/Desktop/minecraft.desktop
  20. echo "Created launcher"
  21. sudo mv ~/Desktop/minecraft.desktop /usr/share/applications/minecraft.desktop
  22. sudo chmod +x /usr/share/applications/minecraft.desktop
  23. sudo chown root /usr/share/applications/minecraft.desktop
  24. sudo chgrp root /usr/share/applications/minecraft.desktop
  25. echo "Fixed permissions, search in the unity a few times for it to show."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement