Fix linux runner script.
This commit is contained in:
parent
0d7b411729
commit
449f55c3e6
@ -2,14 +2,14 @@
|
|||||||
# Basic start script for running MultiMC with the libs packaged with it.
|
# Basic start script for running MultiMC with the libs packaged with it.
|
||||||
|
|
||||||
function printerror {
|
function printerror {
|
||||||
echo $1
|
printf "$1"
|
||||||
if which zenity >/dev/null; then zenity --error --text="$1" &>/dev/null;
|
if which zenity >/dev/null; then zenity --error --text="$1" &>/dev/null;
|
||||||
elif which kdialog >/dev/null; then kdialog --error "$1" &>/dev/null;
|
elif which kdialog >/dev/null; then kdialog --error "$1" &>/dev/null;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $EUID -eq 0 ]]; then
|
if [[ $EUID -eq 0 ]]; then
|
||||||
printerror "This program should not be run using sudo or as the root user"
|
printerror "This program should not be run using sudo or as the root user!\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -39,31 +39,31 @@ if [ "x$DEPS_LIST" = "x" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
# apt
|
# apt
|
||||||
if which apt-file >/dev/null; then
|
if which apt-file &>/dev/null; then
|
||||||
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
||||||
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do apt-file -l search $LIBRARY; done`
|
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do apt-file -l search $LIBRARY; done`
|
||||||
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
||||||
INSTALL_CMD="sudo apt-get install $COMMAND_LIBS"
|
INSTALL_CMD="sudo apt-get install $COMMAND_LIBS"
|
||||||
# pacman
|
# pacman
|
||||||
elif which pkgfile >/dev/null; then
|
elif which pkgfile &>/dev/null; then
|
||||||
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
||||||
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pkgfile $LIBRARY; done`
|
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pkgfile $LIBRARY; done`
|
||||||
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
||||||
INSTALL_CMD="sudo pacman -S $COMMAND_LIBS"
|
INSTALL_CMD="sudo pacman -S $COMMAND_LIBS"
|
||||||
# yum
|
# yum
|
||||||
elif which yum >/dev/null; then
|
elif which yum &>/dev/null; then
|
||||||
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
||||||
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do yum whatprovides $LIBRARY; done`
|
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do yum whatprovides $LIBRARY; done`
|
||||||
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
||||||
INSTALL_CMD="sudo yum install $COMMAND_LIBS"
|
INSTALL_CMD="sudo yum install $COMMAND_LIBS"
|
||||||
# zypper
|
# zypper
|
||||||
elif which zypper >/dev/null; then
|
elif which zypper &>/dev/null; then
|
||||||
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
||||||
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do zypper wp $LIBRARY; done`
|
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do zypper wp $LIBRARY; done`
|
||||||
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
||||||
INSTALL_CMD="sudo zypper install $COMMAND_LIBS"
|
INSTALL_CMD="sudo zypper install $COMMAND_LIBS"
|
||||||
# emerge
|
# emerge
|
||||||
elif which pfl >/dev/null; then
|
elif which pfl &>/dev/null; then
|
||||||
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"`
|
||||||
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pfl $LIBRARY; done`
|
COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pfl $LIBRARY; done`
|
||||||
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'`
|
||||||
@ -71,8 +71,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
MESSAGE="Error: MultiMC is missing the following libraries that it needs to work correctly:\n\t${DEPS_LIST}\nPlease install them from your distribution's package manager."
|
MESSAGE="Error: MultiMC is missing the following libraries that it needs to work correctly:\n\t${DEPS_LIST}\nPlease install them from your distribution's package manager."
|
||||||
MESSAGE="$MESSAGE\n\nHint: $INSTALL_CMD"
|
MESSAGE="$MESSAGE\n\nHint: $INSTALL_CMD\n"
|
||||||
|
|
||||||
printerror $MESSAGE
|
printerror "$MESSAGE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user