Skip to content

Instantly share code, notes, and snippets.

@tene
Created February 19, 2012 00:34
Show Gist options
  • Select an option

  • Save tene/1861455 to your computer and use it in GitHub Desktop.

Select an option

Save tene/1861455 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ ! -f ~/minecraft.jar ] ; then
wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar -O ~/minecraft.jar
fi
BASE="$HOME/mc-installs"
mkdir -p "$BASE"
declare -a dirs
while true ; do
if [ "$(ls -1 "$BASE" | wc -l)" -lt 1 ] ; then
dirs=()
else
dirs=($BASE/*)
fi
select DIR in ${dirs[@]#$BASE/} new quit ; do
case "$DIR" in
new)
read -p 'name: ' NAME
mkdir -p "$BASE/$NAME"
break
;;
quit)
exit
;;
'')
echo 'Choose a number'
;;
*)
unshare -m ~/bin/mc-run "$BASE/$DIR"
esac
done
done
#!/bin/bash
bindfs -n "$1" ~/.minecraft
/usr/java/jre1.7.0_02/bin/java -Xmx1024M -Xms512M -jar ~/minecraft.jar
fusermount -u ~/.minecraft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment