mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Move install process to a sourceable function
This commit is contained in:
parent
63d2e21dbe
commit
00a2251823
@ -141,3 +141,33 @@ function update_msm() {
|
||||
function install_complete() {
|
||||
install_log "Done. Type 'msm help' to get started. Have fun!"
|
||||
}
|
||||
|
||||
function install() {
|
||||
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 install functions as sudo
|
||||
# These functions are defined in another script
|
||||
# after which this script is sourced
|
||||
sudo sh <<SCRIPT
|
||||
|
||||
config_installation
|
||||
update_system_packages
|
||||
install_dependencies
|
||||
add_minecraft_user
|
||||
create_msm_directories
|
||||
download_latest_files
|
||||
patch_latest_files
|
||||
install_config
|
||||
install_cron
|
||||
reload_cron
|
||||
install_init
|
||||
enable_init
|
||||
update_msm
|
||||
install_complete
|
||||
|
||||
SCRIPT
|
||||
}
|
||||
|
@ -31,4 +31,4 @@ function enable_init() {
|
||||
fi
|
||||
}
|
||||
|
||||
bash <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/install.sh)
|
||||
install
|
||||
|
@ -1,27 +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 install functions as sudo
|
||||
# These functions are defined in another script
|
||||
# after which this script is sourced
|
||||
sudo sh <<SCRIPT
|
||||
|
||||
config_installation
|
||||
update_system_packages
|
||||
install_dependencies
|
||||
add_minecraft_user
|
||||
create_msm_directories
|
||||
download_latest_files
|
||||
patch_latest_files
|
||||
install_config
|
||||
install_cron
|
||||
reload_cron
|
||||
install_init
|
||||
enable_init
|
||||
update_msm
|
||||
install_complete
|
||||
|
||||
SCRIPT
|
@ -20,4 +20,4 @@ function enable_init() {
|
||||
chkconfig --add msm
|
||||
}
|
||||
|
||||
source <(wget -qO- https://raw.github.com/marcuswhybrow/minecraft-server-manager/master/installers/install.sh)
|
||||
install
|
||||
|
Loading…
Reference in New Issue
Block a user