summaryrefslogtreecommitdiffstats
path: root/application/package/ubuntu/multimc_1.0-1/opt/multimc/run.sh
blob: 3d9340377c2d173171b30956daafe5956c0d830d (plain)
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
#!/bin/bash

INSTDIR=~/MultiMC

deploy() {
    mkdir -p $INSTDIR
    cd ${INSTDIR}

    wget --progress=dot:force "http://files.multimc.org/downloads/mmc-stable-lin64.tar.gz" 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 mmc-stable-lin64.tar.gz --strip-components=2
    rm mmc-stable-lin64.tar.gz
    chmod +x MultiMC
    ./MultiMC
}

runmmc() {
    cd ${INSTDIR}
    ./MultiMC
}

if [[ ! -f ${INSTDIR}/MultiMC ]]; then
    deploy
else
    runmmc
fi