Daniel Gibbs 4 lat temu
rodzic
commit
e7ffdef7e9

+ 10 - 3
lgsm/functions/alert_discord.sh

@@ -25,8 +25,9 @@ json=$(cat <<EOF
 			"color": "${alertcolourdec}",
 			"fields": [
 				{
-					"name": "Game",
-					"value": "${gamename}"
+				"name": "Game",
+				"value": "${gamename}",
+				"inline": true
 				},
 				{
 				"name": "${alertplayerstitle}",
@@ -53,6 +54,12 @@ json=$(cat <<EOF
 				"value": "${alertversion}",
 				"inline": true
 				},
+				{
+				"name": "Country",
+				"value": "${country}",
+				"inline": true
+				},
+				{
 				"name": "Server time",
 				"value": "${alertdate}",
 				"inline": true
@@ -73,7 +80,7 @@ json=$(cat <<EOF
 				"url": "${alertimage}"
 			},
 			"footer": {
-				"text": "Powered by LinuxGSM ${version} - $(date)",
+				"text": "Powered by LinuxGSM ${version}",
 				"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg"
 			}
 		}

+ 2 - 2
lgsm/functions/core_github.sh

@@ -41,7 +41,7 @@ fn_github_set_latest_release_version(){
 	fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}"
 
 	local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest"
-	githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name' )
+	githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name' )
 
 	# error if no version is there
 	if [ -z "${githubreleaseversion}" ]; then
@@ -76,7 +76,7 @@ fn_github_compare_version(){
 	local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest"
 
 	githublocalversion=$(cat "${githublocalversionfile}")
-	githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name' )
+	githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name' )
 
 	# error if no version is there
 	if [ -z "${githubreleaseversion}" ]; then

+ 3 - 1
lgsm/functions/info_distro.sh

@@ -253,7 +253,9 @@ netlink=$(${ethtoolcommand} "${netint}" 2>/dev/null| grep Speed | awk '{print $2
 
 # External IP address
 if [ -z "${extip}" ]; then
-	extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)"
+	ipapijson=$(curl --connect-timeout 10 -s http://ip-api.com/json)
+	extip="$(echo "${ipapijson}" | jq -r .query)"
+	country="$(echo "${ipapijson}" | jq -r .country)"
 	exitcode=$?
 	# Should ifconfig.co return an error will use last known IP.
 	if [ ${exitcode} -eq 0 ]; then