mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
52f26a6911
* Set dependency installation as non-interactive Fixes: apt waits for user input when installing dependencies #439 * Add sudo and wget as dependencies Fixes: Installer assumes system has sudo and wget installed #440 * Add openjdk-17-jre-headless as dependency The script will install openjdk-17-jre-headless if java isn't installed already. The choice for version 17 was motivated by the fact it is the latest LTS version and also that it is required for running Minecraft 1.18 and above. Fixes: Make java an MSM installation dependency? #295 * Add software-properties-common as dependency The Debian script now installs software-properties-common if not installed, so it can use add-apt-repository. Fixes: Installer assumes software-properties-common is installed on debian system #441 * Fix broken whitespace
30 lines
932 B
Bash
Executable File
30 lines
932 B
Bash
Executable File
UPDATE_URL="https://raw.githubusercontent.com/msmhq/msm/master"
|
|
wget -q ${UPDATE_URL}/installers/common.sh -O /tmp/msmcommon.sh
|
|
source /tmp/msmcommon.sh && rm -f /tmp/msmcommon.sh
|
|
|
|
# Installs sudo if it is not installed
|
|
function install_sudo() {
|
|
yum -yq install sudo
|
|
}
|
|
|
|
function update_system_packages() {
|
|
install_log "Updating sources"
|
|
sudo yum -yq update --skip-broken || install_error "Couldn't update packages"
|
|
}
|
|
|
|
function install_dependencies() {
|
|
install_log "Installing required packages"
|
|
sudo yum -yq install jq rsync screen wget zip || install_error "Couldn't install dependencies"
|
|
if ! command -v java > /dev/null 2>&1; then
|
|
install_log "Installing Java (OpenJDK 17)"
|
|
sudo yum -yq install java-17-openjdk || install_error "Couldn't install Java"
|
|
fi
|
|
}
|
|
|
|
function enable_init() {
|
|
install_log "Enabling automatic startup and shutdown"
|
|
sudo chkconfig --add msm
|
|
}
|
|
|
|
install_msm
|