mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Make install script accessible via HTTP
This commit is contained in:
parent
f068a10360
commit
693dfb13fd
@ -1,2 +0,0 @@
|
||||
cd installers
|
||||
bash install.sh debian.sh
|
@ -1,2 +0,0 @@
|
||||
cd installers
|
||||
bash install.sh redhat.sh
|
47
install.sh
47
install.sh
@ -1,47 +0,0 @@
|
||||
echo "This script requires superuser access to install files to /etc."
|
||||
echo "You will be prompted for your password by sudo."
|
||||
|
||||
# Clear existing sudo credentials
|
||||
sudo -k
|
||||
|
||||
# run script as sudo
|
||||
sudo sh <<SCRIPT
|
||||
|
||||
echo "\033[1;32mMSM INSTALL: Updating sources\033[m"
|
||||
apt-get update
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Installing required packages\033[m"
|
||||
apt-get install screen rsync zip
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Creating default user \"minecraft\"\033[m"
|
||||
adduser --system minecraft
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Creating MSM directories\033[m"
|
||||
mkdir -p /opt/msm
|
||||
chown minecraft:minecraft /opt/msm
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Downloading latest MSM configuration file\033[m"
|
||||
wget https://raw.github.com/marcuswhybrow/minecraft-server-manager/latest/msm.conf -O /etc/msm.conf
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Downloading latest MSM cron file\033[m"
|
||||
wget https://raw.github.com/marcuswhybrow/minecraft-server-manager/latest/cron/msm -O /etc/cron.d/msm
|
||||
service cron reload
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Downloading latest MSM version\033[m"
|
||||
wget https://raw.github.com/marcuswhybrow/minecraft-server-manager/latest/init/msm -O /etc/init.d/msm
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Giving it the necessary permissions\033[m"
|
||||
chmod 755 /etc/init.d/msm
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Enabling automatic startup and shutdown\033[m"
|
||||
update-rc.d msm defaults
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Making MSM accessible as the command \"msm\"\033[m"
|
||||
ln -s /etc/init.d/msm /usr/local/bin/msm
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Asking MSM to update itself\033[m"
|
||||
/etc/init.d/msm update --noinput
|
||||
|
||||
echo "\n\033[1;32mMSM INSTALL: Done. Type \"msm help\" to get started. Have fun!\033[m"
|
||||
|
||||
SCRIPT
|
@ -1,9 +1,5 @@
|
||||
if [ -f defaults.conf ]; then
|
||||
source defaults.conf
|
||||
fi
|
||||
|
||||
msm_dir="${MSM_DIRECTORY:-/opt/msm}"
|
||||
msm_user="${MSM_USERNAME:-minecraft}"
|
||||
msm_dir="/opt/msm"
|
||||
msm_user="minecraft"
|
||||
dl_dir="$(mktemp -t msm)"
|
||||
|
||||
# Outputs an MSM INSTALL log line
|
||||
@ -20,15 +16,32 @@ function install_error() {
|
||||
### NOTE: all the below functions are overloadable for system-specific installs
|
||||
### NOTE: some of the below functions MUST be overloaded due to system-specific installs
|
||||
|
||||
function config_installation() {
|
||||
install_log "Configure installation"
|
||||
echo -n "Install directory [${msm_dir}]: "
|
||||
read msm_dir
|
||||
|
||||
echo -n "New server user to be created [${msm_user}]: "
|
||||
read msm_user
|
||||
|
||||
echo "Complete installation with these values? [y/N]: "
|
||||
read answer
|
||||
|
||||
if [[ $answer != "y" ]]; then
|
||||
echo "Installation aborted."
|
||||
exit 0
|
||||
else
|
||||
}
|
||||
|
||||
# Runs a system software update to make sure we're using all fresh packages
|
||||
function update_system_packages() {
|
||||
# OVERLOAD THIS
|
||||
# OVERLOAD THIS
|
||||
install_error "No function definition for update_system_packages"
|
||||
}
|
||||
|
||||
# Installs additional dependencies (screen, rsync, zip, wget) using system package manager
|
||||
function install_dependencies() {
|
||||
# OVERLOAD THIS
|
||||
# OVERLOAD THIS
|
||||
install_error "No function definition for install_dependencies"
|
||||
}
|
||||
|
||||
@ -100,7 +113,7 @@ function install_cron() {
|
||||
|
||||
# Reloads cron service (if necessary)
|
||||
function reload_cron() {
|
||||
# OVERLOAD THIS
|
||||
# OVERLOAD THIS
|
||||
install_error "No function defined for reload_cron"
|
||||
}
|
||||
|
||||
@ -115,7 +128,7 @@ function install_init() {
|
||||
|
||||
# Enables init script in default runlevels
|
||||
function enable_init() {
|
||||
# OVERLOAD THIS
|
||||
# OVERLOAD THIS
|
||||
install_error "No function defined for enable_init"
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
source common.sh
|
||||
source <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/common.sh)
|
||||
|
||||
function update_system_packages() {
|
||||
install_log "Updating sources"
|
||||
@ -30,3 +30,5 @@ function enable_init() {
|
||||
update-rc.d msm defaults
|
||||
fi
|
||||
}
|
||||
|
||||
source <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/install.sh)
|
||||
|
@ -1,4 +0,0 @@
|
||||
# vim:syn=sh:
|
||||
# Configure default MSM username and server directory
|
||||
MSM_USERNAME="minecraft"
|
||||
MSM_DIRECTORY="/opt/msm"
|
@ -4,13 +4,12 @@ echo "You will be prompted for your password by sudo."
|
||||
# Clear existing sudo credentials
|
||||
sudo -k
|
||||
|
||||
# Get platform-specific install functions from command arguments
|
||||
install_file="${1:-debian.sh}"
|
||||
|
||||
# run script as sudo
|
||||
# Run install functions as sudo
|
||||
# These functions are defined in another script
|
||||
# after which this script is sourced
|
||||
sudo sh <<SCRIPT
|
||||
|
||||
source "$install_file"
|
||||
config_installation
|
||||
update_system_packages
|
||||
install_dependencies
|
||||
add_minecraft_user
|
||||
|
@ -1,4 +1,4 @@
|
||||
source common.sh
|
||||
source <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/common.sh)
|
||||
|
||||
function update_system_packages() {
|
||||
install_log "Updating sources"
|
||||
@ -19,3 +19,5 @@ function enable_init() {
|
||||
install_log "Enabling automatic startup and shutdown"
|
||||
chkconfig --add msm
|
||||
}
|
||||
|
||||
source <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/install.sh)
|
||||
|
Loading…
Reference in New Issue
Block a user