mcwrapper 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  module MCWrapper
2
2
  # VERSION = `#{ MCWRAPPER } --version`.split(/\s/).last
3
- VERSION = '1.6.3'
3
+ VERSION = '1.6.4'
4
4
  end
@@ -6,7 +6,7 @@
6
6
  # https://github.com/spikegrobstein/mcwrapper
7
7
  ##
8
8
 
9
- MCWRAPPER_VERSION="1.6.3"
9
+ MCWRAPPER_VERSION="1.6.4"
10
10
 
11
11
  #### Exit Codes
12
12
 
@@ -577,6 +577,7 @@ function run_installer () {
577
577
  # check for configuration
578
578
  local CURRENT_CONFIG_PATH=`get_config_path`
579
579
 
580
+ # check for default configuration
580
581
  if [[ -z "$CURRENT_CONFIG_PATH" ]]; then
581
582
  echo "Using default configuration."
582
583
  echo "An example configuration is included in the mcwrapper package."
@@ -586,6 +587,7 @@ function run_installer () {
586
587
  fi
587
588
  echo ""
588
589
 
590
+ # sanity check for minecraft server paths
589
591
  if [[ -z "$MINECRAFT_SERVER_PATH" ]]; then
590
592
  MINECRAFT_SERVER_PATH="./${MINECRAFT_SERVER_NAME}"
591
593
  MINECRAFT_SERVER_DIR_PATH="./"
@@ -637,7 +639,7 @@ function download_minecraft_server () {
637
639
  || { echo "curl does not appear to be installed. This is required to download the Minecraft server" >&2; exit $EXIT_NO_CURL; }
638
640
 
639
641
  # parse the download page and read the minecraft_server.jar download URI
640
- local MINECRAFT_SERVER_DOWNLOAD_URI="https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar"
642
+ local MINECRAFT_SERVER_DOWNLOAD_URI=$( get_server_download_uri )
641
643
 
642
644
  # check if there was an error grabbing the download page (either curl returns a bad value or we didn't find the URI)
643
645
  if [[ "$?" != "0" || -z "$MINECRAFT_SERVER_DOWNLOAD_URI" ]]; then
@@ -693,6 +695,22 @@ function download_minecraft_server () {
693
695
  fi
694
696
  }
695
697
 
698
+ # pull html from the minecraft.net download page and parse it
699
+ # extract the linux minecraft_server download URI
700
+ function get_server_download_uri () {
701
+ local MINECRAFT_DOWNLOAD_PAGE="http://minecraft.net/download"
702
+
703
+ # fetch the page
704
+ # pull all the links off it
705
+ # filter down to only the linux server download link
706
+ # extract the .jar URL
707
+ curl -s "$MINECRAFT_DOWNLOAD_PAGE" \
708
+ | grep -o -E '<a .+?>' \
709
+ | grep -E 'data-platform=.linux' \
710
+ | grep -E 'data-dist=.server' \
711
+ | grep -o -E 'https:.+?jar'
712
+ }
713
+
696
714
  # backs up an old minecraft_server.jar file before downloading a new one
697
715
  # if something fails, it prints an error message and exits
698
716
  function backup_old_server () {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcwrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-04 00:00:00.000000000 Z
12
+ date: 2013-08-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Control your Minecraft server. start/stop and live backups.
15
15
  email: