@@ -4,21 +4,35 @@ UPDATE_URL="https://raw.githubusercontent.com/msmhq/msm/master"
44wget -q ${UPDATE_URL} /installers/common.sh -O /tmp/msmcommon.sh
55source /tmp/msmcommon.sh && rm -f /tmp/msmcommon.sh
66
7+ # Installs sudo if it is not installed
8+ function install_sudo() {
9+ install_log " Installing sudo"
10+ DEBIAN_FRONTEND=noninteractive apt-get -yqq install sudo
11+ }
12+
713function update_system_packages() {
814 install_log " Updating sources"
915 if [ -f /etc/os-release ]; then
1016 . /etc/os-release
1117 if [ " $NAME " == ' Ubuntu' ]; then
18+ if ! command -v add-apt-repository > /dev/null 2>&1 ; then
19+ sudo apt-get -yqq install software-properties-common
20+ fi
21+
1222 sudo add-apt-repository universe || install_error " Couldn't enable universe repository"
1323 fi
1424 fi
15- sudo apt-get update || install_error " Couldn't update package list"
16- sudo apt-get upgrade || install_error " Couldn't upgrade packages"
25+ sudo apt-get -yqq update || install_error " Couldn't update package list"
26+ DEBIAN_FRONTEND=noninteractive sudo apt-get -yqq upgrade || install_error " Couldn't upgrade packages"
1727}
1828
1929function install_dependencies() {
2030 install_log " Installing required packages"
21- sudo apt-get install screen rsync zip jq || install_error " Couldn't install dependencies"
31+ DEBIAN_FRONTEND=noninteractive sudo apt-get -yqq install jq rsync screen wget zip || install_error " Couldn't install dependencies"
32+ if ! command -v java > /dev/null 2>&1 ; then
33+ install_log " Installing Java (OpenJDK 17)"
34+ DEBIAN_FRONTEND=noninteractive sudo apt-get -yqq install openjdk-17-jre-headless || install_error " Couldn't install Java"
35+ fi
2236}
2337
2438function enable_init() {
0 commit comments