Fix Linux Mint codename
This commit is contained in:
45
installJRMC
45
installJRMC
@@ -1627,6 +1627,8 @@ update_self() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo HERE2
|
||||||
|
|
||||||
# Download the latest version of the script
|
# Download the latest version of the script
|
||||||
install_package --silent wget
|
install_package --silent wget
|
||||||
if command -v wget &>/dev/null; then
|
if command -v wget &>/dev/null; then
|
||||||
@@ -1637,34 +1639,33 @@ update_self() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extract and normalize versions inline without subshells
|
echo HERE3
|
||||||
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=""
|
declare -p
|
||||||
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 HERE4
|
# 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}
|
||||||
|
|
||||||
[[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
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"
|
echo "$remote_version, $local_version"
|
||||||
|
|
||||||
|
|
||||||
|
[[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
||||||
|
|
||||||
|
|
||||||
echo HERE5
|
echo HERE5
|
||||||
|
|
||||||
if [[ $local_version < $remote_version ]]; then
|
if [[ $local_version < $remote_version ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user