Преглед изворни кода

git binary is not necessary now.

DieFeM пре 9 година
родитељ
комит
2b9ed3744e
1 измењених фајлова са 3 додато и 9 уклоњено
  1. 3 9
      bin/ogp_agent

+ 3 - 9
bin/ogp_agent

@@ -140,28 +140,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