diff options
author | lshprung <lshprung@yahoo.com> | 2021-08-17 17:38:27 -0700 |
---|---|---|
committer | lshprung <lshprung@yahoo.com> | 2021-08-17 17:38:27 -0700 |
commit | cd9121bcc58c94c91c22e2758eb6b8bac5ebf9b2 (patch) | |
tree | 94d5bc13074b67c388109daf5a18a0d7d12c1de7 | |
parent | d11e881244e3661cb00c3359497e24ef98d62735 (diff) |
Progress to comparing versions
-rwxr-xr-x | compare_versions.sh | 10 | ||||
-rwxr-xr-x | update_ungoogled_chromium-portable_linux_64.sh | 19 |
2 files changed, 18 insertions, 11 deletions
diff --git a/compare_versions.sh b/compare_versions.sh index b205a66..757100d 100755 --- a/compare_versions.sh +++ b/compare_versions.sh @@ -13,16 +13,6 @@ IFS='.' read -ra V1 <<< "$1" read -ra V2 <<< "$2" -# DEBUG -for val in "${V1[@]}"; do - echo "$val" -done -echo ${#V1[@]} -for val in "${V2[@]}"; do - echo "$val" -done -echo ${#V2[@]} - # Determine shorter array (for the loop) LENGTH=${#V1[@]} diff --git a/update_ungoogled_chromium-portable_linux_64.sh b/update_ungoogled_chromium-portable_linux_64.sh index e8d7d32..05ee765 100755 --- a/update_ungoogled_chromium-portable_linux_64.sh +++ b/update_ungoogled_chromium-portable_linux_64.sh @@ -3,6 +3,10 @@ # Shell script to update ungoogled-chromium Portable Linux 64-bit to the latest version # $1 -> Wrapper symlink location # $2 (optional) -> Install location +# Return Values: + # 0 -> failed + # 1 -> success, installed new version + # 2 -> success, did not install new version # If first time installing: user must specify a symlink location and an installation directory # If checking for updates: user must pass a symlink for ungoogled-chromium (this is typically just the command name if a symlink is part of the path) @@ -55,5 +59,18 @@ if [ -h "$1" ]; then echo "$MY_VERSION" # Compare versions to determine if an update is necessary -fi + $(get_absolute_path "compare_versions.sh") "$VERSION" "$MY_VERSION" + if [ $? -eq 0 ]; then + echo "ungoogled-chromium $MY_VERSION is up to date" + exit 2 + fi + + echo -n "Upgrade ungoogled-chromium to $VERSION? [Y/n] " + read INPUT + if [ "$INPUT" == "n" ]; then + exit 2 + fi + # Prepare variables for upgrade + echo "ready to go" +fi |