|
@@ -1627,6 +1627,8 @@ update_self() {
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
+ echo HERE2
|
|
|
+
|
|
|
# Download the latest version of the script
|
|
|
install_package --silent wget
|
|
|
if command -v wget &>/dev/null; then
|
|
@@ -1637,34 +1639,33 @@ update_self() {
|
|
|
return 1
|
|
|
fi
|
|
|
|
|
|
- # Extract and normalize versions inline without subshells
|
|
|
- local local_version=""
|
|
|
- while IFS= read -r line; do
|
|
|
- echo $line
|
|
|
- case "$line" in
|
|
|
- *SCRIPT_VERSION=*) local_version=${line#*=}; break;;
|
|
|
- esac
|
|
|
- done < "$SCRIPT_PATH"
|
|
|
- local_version=${local_version#\"} # Remove leading '"'
|
|
|
- local_version=${local_version%\"} # Remove trailing '"'
|
|
|
- local_version=${local_version%-dev} # Remove '-dev' suffix
|
|
|
-
|
|
|
- local remote_version=""
|
|
|
- while IFS= read -r line; do
|
|
|
- case "$line" in
|
|
|
- *SCRIPT_VERSION=*) remote_version=${line#*=}; break;;
|
|
|
- esac
|
|
|
- done < "$tmp"
|
|
|
- remote_version=${remote_version#\"} # Remove leading '"'
|
|
|
- remote_version=${remote_version%\"} # Remove trailing '"'
|
|
|
- remote_version=${remote_version%-dev} # Remove '-dev' suffix
|
|
|
+ echo HERE3
|
|
|
|
|
|
- echo HERE4
|
|
|
+ declare -p
|
|
|
|
|
|
- [[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
|
|
+ # Extract and normalize versions using grep
|
|
|
+ local local_version
|
|
|
+ grep -m 1 'SCRIPT_VERSION=' "$SCRIPT_PATH"
|
|
|
+ local_version=$(grep -m 1 'SCRIPT_VERSION=' "$SCRIPT_PATH")
|
|
|
+ local_version=${local_version#*=}
|
|
|
+ local_version=${local_version#\"}
|
|
|
+ local_version=${local_version%\"}
|
|
|
+ local_version=${local_version%-dev}
|
|
|
+
|
|
|
+ local remote_version
|
|
|
+ grep -m 1 'SCRIPT_VERSION=' "$SCRIPT_PATH"
|
|
|
+ remote_version=$(grep -m 1 'SCRIPT_VERSION=' "$tmp")
|
|
|
+ remote_version=${remote_version#*=}
|
|
|
+ remote_version=${remote_version#\"}
|
|
|
+ remote_version=${remote_version%\"}
|
|
|
+ remote_version=${remote_version%-dev}
|
|
|
|
|
|
echo "$remote_version, $local_version"
|
|
|
|
|
|
+
|
|
|
+ [[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
|
|
+
|
|
|
+
|
|
|
echo HERE5
|
|
|
|
|
|
if [[ $local_version < $remote_version ]]; then
|