From 5eaef8b5b8ae8cfb0cc5633167106e4fbee06288 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Jun 2025 07:25:04 -0700 Subject: [PATCH] Update sysEnv.sh enhance with git update check Co-Authored-By: Johannes le Roux --- script/sysEnv.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/script/sysEnv.sh b/script/sysEnv.sh index e220b01..388744c 100644 --- a/script/sysEnv.sh +++ b/script/sysEnv.sh @@ -24,4 +24,21 @@ else fi # print telemetry data rounded to 2 decimal places -printf "Disk:%s RAM:%.2f%% CPU:%.2f%% CPU-T:%.2f°C (%.2f°F)\n" "$free_space" "$ram_usage" "$cpu_usage" "$temp" "$tempf" \ No newline at end of file +printf "Disk:%s RAM:%.2f%% CPU:%.2f%% CPU-T:%.2f°C (%.2f°F)\n" "$free_space" "$ram_usage" "$cpu_usage" "$temp" "$tempf" + +# attempt check for updates +if command -v git &> /dev/null +then + if [ -d ../.git ]; then + # check for updates + git fetch --quiet + local_branch=$(git rev-parse --abbrev-ref HEAD) + if [ "$local_branch" != "HEAD" ] && git show-ref --verify --quiet "refs/remotes/origin/$local_branch"; then + local_commit=$(git rev-parse "$local_branch") + remote_commit=$(git rev-parse "origin/$local_branch") + if [ "$local_commit" != "$remote_commit" ]; then + echo "Bot Update Available!" + fi + fi + fi +fi