summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcompare_versions.sh10
-rwxr-xr-xupdate_ungoogled_chromium-portable_linux_64.sh19
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