GH-1179 incorporate fixes for comments from linked changeset

Use SSL for downloads
Use XDG dirs for storage
Do not run from deploy function
This commit is contained in:
Petr Mrázek 2015-09-28 23:28:40 +02:00
parent 00994a425e
commit 12b14c3400

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
INSTDIR=~/.multimc INSTDIR=$XDG_DATA_HOME/multimc
if [ `getconf LONG_BIT` = "64" ] if [ `getconf LONG_BIT` = "64" ]
then then
PACKAGE="mmc-stable-lin64.tar.gz" PACKAGE="mmc-stable-lin64.tar.gz"
@ -12,12 +12,11 @@ deploy() {
mkdir -p $INSTDIR mkdir -p $INSTDIR
cd ${INSTDIR} cd ${INSTDIR}
wget --progress=dot:force "http://files.multimc.org/downloads/${PACKAGE}" 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# Downloading at \2\/s, ETA \3/' | zenity --progress --auto-close --auto-kill --title="Downloading MultiMC..." wget --progress=dot:force "https://files.multimc.org/downloads/${PACKAGE}" 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# Downloading at \2\/s, ETA \3/' | zenity --progress --auto-close --auto-kill --title="Downloading MultiMC..."
tar -xzf ${PACKAGE} --transform='s,MultiMC/,,' tar -xzf ${PACKAGE} --transform='s,MultiMC/,,'
rm ${PACKAGE} rm ${PACKAGE}
chmod +x MultiMC chmod +x MultiMC
./MultiMC
} }
runmmc() { runmmc() {
@ -27,6 +26,7 @@ runmmc() {
if [[ ! -f ${INSTDIR}/MultiMC ]]; then if [[ ! -f ${INSTDIR}/MultiMC ]]; then
deploy deploy
runmmc
else else
runmmc runmmc
fi fi