Sfoglia il codice sorgente

Merge branch 'master' of github.com:OpenGamePanel/OGP-Agent-Windows

Merged because of conflict
own3mall 9 anni fa
parent
commit
9ec0d6e32d
1 ha cambiato i file con 3 aggiunte e 9 eliminazioni
  1. 3 9
      bin/ogp_agent

+ 3 - 9
bin/ogp_agent

@@ -132,28 +132,22 @@ checkDepends() {
 	else
 		echo "INFO: Located unzip: $UNZIP"
 	fi
-	GIT=`which git 2>/dev/null`
-	if test "$?" -gt 0; then
-		echo "WARNING: Failed to locate git binary."
-	else
-		echo "INFO: Located git: $GIT"
-	fi
 }
 
 update() {
 	# Run the git update
 	if test -n "$AUTO_UPDATE"; then
-		if [ -z "$CURL" -o -z "$UNZIP" -o -z "$GIT" ]; then
+		if [ -z "$CURL" -o -z "$UNZIP" ]; then
 			checkDepends
 		fi
-		if [ -f "$CURL" -a -x "$CURL" ] && [ -f "$UNZIP" -a -x "$UNZIP" ] && [ -f "$GIT" -a -x "$GIT" ]; then
+		if [ -f "$CURL" -a -x "$CURL" ] && [ -f "$UNZIP" -a -x "$UNZIP" ]; then
 			cd $AGENTDIR
 			if [ ! -d tmp ]; then
 				mkdir tmp
 			fi
 			cd tmp
 			REPONAME=OGP-Agent-Windows
-			REVISION=`git ls-remote --heads https://github.com/OpenGamePanel/${REPONAME}.git | grep -owE "^[^?\s]+"`
+			REVISION=`curl -s https://github.com/OpenGamePanel/${REPONAME}/commits/master.atom | egrep -o "([a-f0-9]{40})" | awk 'NR==1{print $1}'`
 			curl -Os https://raw.githubusercontent.com/OpenGamePanel/${REPONAME}/${REVISION}/bin/ogp_agent
 			diff ./ogp_agent /bin/ogp_agent &>/dev/null
 			if test $? -ne 0; then