2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								/ *  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  Minio  Cloud  Storage ,  ( C )  2015  Minio ,  Inc . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  Licensed  under  the  Apache  License ,  Version  2.0  ( the  "License" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  you  may  not  use  this  file  except  in  compliance  with  the  License . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  You  may  obtain  a  copy  of  the  License  at 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *      http : //www.apache.org/licenses/LICENSE-2.0
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  Unless  required  by  applicable  law  or  agreed  to  in  writing ,  software 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  distributed  under  the  License  is  distributed  on  an  "AS IS"  BASIS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  WITHOUT  WARRANTIES  OR  CONDITIONS  OF  ANY  KIND ,  either  express  or  implied . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  See  the  License  for  the  specific  language  governing  permissions  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 *  limitations  under  the  License . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 07:23:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								package  cmd  
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								import  (  
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									"bytes" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"encoding/json" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"errors" 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"io/ioutil" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"net/http" 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									"os" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"runtime" 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"strings" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"time" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"github.com/fatih/color" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"github.com/minio/cli" 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-04 17:50:59 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									"github.com/minio/mc/pkg/console" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// command specific flags.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									updateFlags  =  [ ] cli . Flag { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										cli . BoolFlag { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											Name :   "experimental, E" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											Usage :  "Check experimental update." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// Check for new software updates.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var  updateCmd  =  cli . Command {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Name :    "update" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Usage :   "Check for a new software update." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Action :  mainUpdate , 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-02 06:12:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									Flags :   append ( updateFlags ,  globalFlags ... ) , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									CustomHelpTemplate :  ` Name : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   minio  { { . Name } }  -  { { . Usage } } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								USAGE :  
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   minio  { { . Name } }  [ FLAGS ] 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								FLAGS :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  { { range  . Flags } } { { . } } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  { { end } } 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								EXAMPLES :  
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   1.  Check  for  any  new  official  release . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      $  minio  { { . Name } } 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   2.  Check  for  any  new  experimental  release . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      $  minio  { { . Name } }  -- experimental 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								` ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// update URL endpoints.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								const  (  
						 
					
						
							
								
									
										
										
										
											2016-07-15 05:08:16 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									minioUpdateStableURL        =  "https://dl.minio.io/server/minio/release" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									minioUpdateExperimentalURL  =  "https://dl.minio.io/server/minio/experimental" 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// updateMessage container to hold update messages.
  
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								type  updateMessage  struct  {  
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Status    string  ` json:"status" ` 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Update    bool    ` json:"update" ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Download  string  ` json:"downloadURL" ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Version   string  ` json:"version" ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// String colorized update message.
  
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								func  ( u  updateMessage )  String ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ! u . Update  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										updateMessage  :=  color . New ( color . FgGreen ,  color . Bold ) . SprintfFunc ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
										return  updateMessage ( "You are already running the most recent version of ‘ ’  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-13 10:35:28 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									msg  :=  colorizeUpdateMessage ( u . Download ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									return  msg 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// JSON jsonified update message.
  
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								func  ( u  updateMessage )  JSON ( )  string  {  
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									u . Status  =  "success" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									updateMessageJSONBytes ,  err  :=  json . Marshal ( u ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-17 05:31:28 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									fatalIf ( ( err ) ,  "Unable to marshal into JSON." ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									return  string ( updateMessageJSONBytes ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								func  parseReleaseData ( data  string )  ( time . Time ,  error )  {  
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									releaseStr  :=  strings . Fields ( data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  len ( releaseStr )  <  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  errors . New ( "Update data malformed" ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									releaseDate  :=  releaseStr [ 1 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									releaseDateSplits  :=  strings . SplitN ( releaseDate ,  "." ,  3 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  len ( releaseDateSplits )  <  3  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  ( errors . New ( "Update data malformed" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  releaseDateSplits [ 0 ]  !=  "minio"  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  ( errors . New ( "Update data malformed, missing minio tag" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// "OFFICIAL" tag is still kept for backward compatibility.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// We should remove this for the next release.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-24 06:57:14 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  releaseDateSplits [ 1 ]  !=  "RELEASE"  &&  releaseDateSplits [ 1 ]  !=  "OFFICIAL"  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  ( errors . New ( "Update data malformed, missing RELEASE tag" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									dateSplits  :=  strings . SplitN ( releaseDateSplits [ 2 ] ,  "T" ,  2 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  len ( dateSplits )  <  2  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  ( errors . New ( "Update data malformed, not in modified RFC3359 form" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									dateSplits [ 1 ]  =  strings . Replace ( dateSplits [ 1 ] ,  "-" ,  ":" ,  - 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									date  :=  strings . Join ( dateSplits ,  "T" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-30 05:24:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									parsedDate ,  err  :=  time . Parse ( time . RFC3339 ,  date ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  time . Time { } ,  err 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 09:11:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									return  parsedDate ,  nil 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// User Agent should always following the below style.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// Please open an issue to discuss any new changes here.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								//
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								//       Minio (OS; ARCH) APP/VER APP/VER
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									userAgentSuffix  =  "Minio/"  +  Version  +  " "  +  "Minio/"  +  ReleaseTag  +  " "  +  "Minio/"  +  CommitID 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								)  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// Check if the operating system is a docker container.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								func  isDocker ( )  bool  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									cgroup ,  err  :=  ioutil . ReadFile ( "/proc/self/cgroup" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  &&  os . IsNotExist ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									fatalIf ( err ,  "Unable to read `cgroup` file." ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									return  bytes . Contains ( cgroup ,  [ ] byte ( "docker" ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// verify updates for releases.
  
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								func  getReleaseUpdate ( updateURL  string ,  duration  time . Duration )  ( updateMsg  updateMessage ,  errMsg  string ,  err  error )  {  
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Construct a new update url.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-28 03:43:26 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									newUpdateURLPrefix  :=  updateURL  +  "/"  +  runtime . GOOS  +  "-"  +  runtime . GOARCH 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									newUpdateURL  :=  newUpdateURLPrefix  +  "/minio.shasum" 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Get the downloadURL.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  downloadURL  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									switch  runtime . GOOS  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-14 14:34:55 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									case  "windows" : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										// For windows.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 17:41:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										downloadURL  =  newUpdateURLPrefix  +  "/minio.exe" 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										// For all other operating systems.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 17:41:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										downloadURL  =  newUpdateURLPrefix  +  "/minio" 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Initialize update message.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									updateMsg  =  updateMessage { 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										Download :  downloadURL , 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 07:23:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										Version :   Version , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-07-12 07:22:10 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Instantiate a new client with 3 sec timeout.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									client  :=  & http . Client { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										Timeout :  duration , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Parse current minio version into RFC3339.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 07:23:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									current ,  err  :=  time . Parse ( time . RFC3339 ,  Version ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										errMsg  =  "Unable to parse version string as time." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Verify if current minio version is zero.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  current . IsZero ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										err  =  errors . New ( "date should not be zero" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										errMsg  =  "Updates mechanism is not supported for custom builds. Please download official releases from https://minio.io/#minio" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// Initialize new request.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									req ,  err  :=  http . NewRequest ( "GET" ,  newUpdateURL ,  nil ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 04:44:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									userAgentPrefix  :=  func ( )  string  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										if  isDocker ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											return  "Minio ("  +  runtime . GOOS  +  "; "  +  runtime . GOARCH  +  "; "  +  "docker) " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return  "Minio ("  +  runtime . GOOS  +  "; "  +  runtime . GOARCH  +  ") " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// Set user agent.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 04:44:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									req . Header . Set ( "User-Agent" ,  userAgentPrefix + " " + userAgentSuffix ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// Fetch new update.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									resp ,  err  :=  client . Do ( req ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Verify if we have a valid http response i.e http.StatusOK.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  resp  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										if  resp . StatusCode  !=  http . StatusOK  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
											errMsg  =  "Failed to retrieve update notice." 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
											err  =  errors . New ( "http status : "  +  resp . Status ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
											return 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Read the response body.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									updateBody ,  err  :=  ioutil . ReadAll ( resp . Body ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										errMsg  =  "Failed to retrieve update notice. Please try again later." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									errMsg  =  "Failed to retrieve update notice. Please try again later. Please report this issue at https://github.com/minio/minio/issues" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Parse the date if its valid.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									latest ,  err  :=  parseReleaseData ( string ( updateBody ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  err  !=  nil  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Verify if the date is not zero.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  latest . IsZero ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										err  =  errors . New ( "date should not be zero" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Is the update latest?.
 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  latest . After ( current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										updateMsg . Update  =  true 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Return update message.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									return  updateMsg ,  "" ,  nil 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// main entry point for update command.
  
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								func  mainUpdate ( ctx  * cli . Context )  {  
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// Error out if 'update' command is issued for development based builds.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  Version  ==  "DEVELOPMENT.GOGET"  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
										fatalIf ( errors . New ( "" ) ,  "Update mechanism is not supported for ‘ ’  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-25 08:20:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Check for update.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									var  updateMsg  updateMessage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  errMsg  string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  err  error 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									var  secs  =  time . Second  *  3 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ctx . Bool ( "experimental" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										updateMsg ,  errMsg ,  err  =  getReleaseUpdate ( minioUpdateExperimentalURL ,  secs ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 13:06:29 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 09:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										updateMsg ,  errMsg ,  err  =  getReleaseUpdate ( minioUpdateStableURL ,  secs ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-19 23:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									fatalIf ( err ,  errMsg ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									console . Println ( updateMsg ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-18 06:03:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}