From 8e8f46f4a3443e39d76ad5877d907a04370f6988 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sun, 12 Jun 2022 19:35:10 +0000 Subject: [PATCH 01/16] typo in --help --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index 1c28a7b8..7bd059de 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -9,7 +9,7 @@ help(){ echo "Basic Utilities" echo "--mount | Initiates mounting feature, choose between unmounting and mounting PVC data" echo "--restore | Opens a menu to restore a \"heavy_script\" backup that was taken on your \"ix-applications\" dataset" -echo "--delete backup | Opens a menu to delete backups on your system" +echo "--delete-backup | Opens a menu to delete backups on your system" echo "--dns | list all of your applications DNS names and their web ports" echo echo "Update Options" From e325ab0a3a9997ec6df9d149d5645a8467496676 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 13 Jun 2022 04:48:10 +0000 Subject: [PATCH 02/16] fix DNS regex Exclude dependency pods unless they were launched with custom-app. --- heavy_script.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index 7bd059de..8eb2b15b 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -24,14 +24,14 @@ echo "-v | verbose output" echo "-t | Set a custom timeout in seconds when checking if either an App or Mountpoint correctly Started, Stopped or (un)Mounted. Defaults to 500 seconds" echo "-s | sync catalog" echo "-p | Prune unused/old docker images" -echo +echo echo "Examples" echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -vrsUp" echo "bash /mnt/tank/scripts/heavy_script.sh -t 150 --mount" echo "bash /mnt/tank/scripts/heavy_script.sh --dns" -echo "bash /mnt/tank/scripts/heavy_script.sh --restore" +echo "bash /mnt/tank/scripts/heavy_script.sh --restore" echo "bash /mnt/tank/scripts/heavy_script.sh --delete-backup" -echo +echo exit } export -f help @@ -102,8 +102,8 @@ export -f restore dns(){ clear -x echo "Generating DNS Names.." -#ignored dependency pods, No change required -dep_ignore="cron|kube-system|nvidia|svclb|NAME|memcached" +#ignored dependency pods, may need to add more in the future. +dep_ignore="\-cronjob\-|^kube-system|\ssvclb|NAME|\-memcached\-.[^custom\-app]|\-postgresql\-.[^custom\-app]|\-redis\-.[^custom\-app]|\-mariadb\-.[^custom\-app]|\-promtail\-.[^custom\-app]" # Pulling pod names mapfile -t main < <(k3s kubectl get pods -A | grep -Ev "$dep_ignore" | sort) From 893004fe5838a5c86748f60d128105e96a928a52 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 13 Jun 2022 16:20:35 -0600 Subject: [PATCH 03/16] add self update option --- README.md | 24 ++++++++++-------------- heavy_script.sh | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f7717f6e..d41f2613 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ | Flag | Example | Parameter | Description | |----------------- |------------------------ |----------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| --self-update | --self-update | None | Updates HeavyScript prior to running it
_You no longer need to git pull_ | | --delete-backup | --delete-backup | None | Opens a menu to delete backups
_Useful if you need to delete old system backups or backups from other scripts_ | | --restore | --restore | None | Restore HeavyScript specific `ix-applications dataset` snapshot | | --mount | --mount | None | Initiates mounting feature
Choose between unmounting and mounting PVC data | @@ -36,7 +37,7 @@ ### Examples #### Typical Cron Job ``` -bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -rsup +bash heavy_script.sh --self-update -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -rsup ``` > `-b` is set to 14. Up to 14 snapshots of your ix-applications dataset will be saved @@ -53,6 +54,8 @@ bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -rsup > `-p` Prune docker images. +> `--self-update` Will update the script prior to running anything else. + #### Mounting PVC Data ``` @@ -79,7 +82,7 @@ bash /mnt/tank/scripts/heavy_script/heavy_script.sh --dns #### My personal Cron Job ``` -git -C /mnt/speed/scripts/heavy_script pull && bash /mnt/speed/scripts/heavy_script/heavy_script.sh -b 14 -rsup +bash /mnt/speed/scripts/heavy_script/heavy_script.sh --self-update -b 14 -rsup ```
@@ -111,7 +114,7 @@ cd heavy_script From here, you can just run Heavy_Script with `bash heavy_script.sh -ARGUMENTS` -> Note: `chmod +x` is NOT required. Doing this will break the `git pull` function. Just run the script with `bash heavy_script.sh` +> Note: `chmod +x` is NOT required. Doing this will break the `git pull` (or self update) function. Just run the script with `bash heavy_script.sh`
@@ -132,20 +135,13 @@ git pull ```
-### Update with your Cron Job +### Update with the scripts built-in option -Here, we will update the script prior to running it, incase there is a bugfix, or any new additions to the script - -**Cron Job Command** ``` -git -C /mnt/speed/scripts/heavy_script pull && bash /mnt/speed/scripts/heavy_script/heavy_script.sh -b 14 -rsup +bash heavyscript --self-update -b 14 -supr ``` -> The important command here is the `git -C /PATH/TO/HEAVY_SCRIPT_DIRECTORY pull` +> The important argument here is the `--self-update`, you can still use all of your same arguments with this option. -> This command will allow you to preform a `git pull` on a remote directory, which will ensure your script is udated prior to running it - -> `&&` Is used to run a command AFTER the previous command completed successfully ->> So once the `git -C /PATH/TO/HEAVY_SCRIPT_DIRECTORY pull` command completes, THEN it will run the `bash /PATH/TO/HEAVY_SCRIPT_DIRECTORY/heavy_script.sh -b 14 -rsup` command

@@ -161,7 +157,7 @@ git -C /mnt/speed/scripts/heavy_script pull && bash /mnt/speed/scripts/heavy_scr | Name | Value | Reason | |------------------------ |------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `Description` | HeavyScript git pull and Update apps | This is up to you, put whatever you think is a good description in here | -| `Command` | `git -C /PATH/TO/HEAVY_SCRIPT_DIRECTORY pull && bash /PATH/TO/HEAVY_SCRIPT_DIRECTORY/heavy_script.sh -b 14 -rsup` | This is the command you will be running on your schedule I personally use: `git -C /mnt/speed/scripts/heavy_script pull && bash /mnt/speed/scripts/heavy_script/heavy_script.sh -b 14 -rsup` | +| `Command` | `bash /PATH/TO/HEAVY_SCRIPT_DIRECTORY/heavy_script.sh --self-update -b 14 -rsup` | This is the command you will be running on your schedule I personally use: `bash /mnt/speed/scripts/heavy_script/heavy_script.sh --self-update -b 14 -rsup` | | `Run As User` | `root` | Running the script as `root` is REQUIRED. You cannot access all of the kubernetes functions without this user. | | `Schedule` | Up to you, I run mine everyday at `0400` | Again up to you | | `Hide Standard Output` | `False` or Unticked | I like to receive an email report of how the script ran, what apps updated etc. | diff --git a/heavy_script.sh b/heavy_script.sh index 8eb2b15b..4ba89019 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -3,6 +3,35 @@ #If no argument is passed, kill the script. [[ -z "$*" || "-" == "$*" || "--" == "$*" ]] && echo "This script requires an argument, use --help for help" && exit +args=("$@") + +self_update() { +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") +SCRIPTNAME="$0" +cd $SCRIPTPATH +git fetch &> /dev/null + +[[ -n $(git diff --name-only origin/main | grep $SCRIPTNAME) ]] && { + echo "Found a new version of HeavyScript, updating myself..." + git pull --force &> /dev/null + echo -e "Running the new version...\n" + count=0 + for i in "${args[@]}" + do + [[ "$i" == "--self-update" ]] && unset "args[$count]" && break + ((count++)) + done + sleep 5 + exec bash "$SCRIPTNAME" "${args[@]}" + + # Now exit this old instance + exit + } + echo -e "HeavyScript is already the latest version.\n" +} + + help(){ [[ $help == "true" ]] && clear -x @@ -342,9 +371,12 @@ do case $opt in -) case "${OPTARG}" in - help) + help) help="true" ;; + self-update) + self_update="true" + ;; dns) dns="true" ;; @@ -423,6 +455,7 @@ done #Continue to call functions in specific order [[ "$help" == "true" ]] && help +[[ "$self_update" == "true" ]] && self_update [[ "$deleteBackup" == "true" ]] && deleteBackup && exit [[ "$dns" == "true" ]] && dns && exit [[ "$restore" == "true" ]] && restore && exit From b984d2873e88c4e2b73ea6ff1df992ac4f2c6991 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 13 Jun 2022 22:22:29 +0000 Subject: [PATCH 04/16] typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d41f2613..c1529c08 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ git pull ### Update with the scripts built-in option ``` -bash heavyscript --self-update -b 14 -supr +bash heavyscript.sh --self-update -b 14 -supr ``` > The important argument here is the `--self-update`, you can still use all of your same arguments with this option. From 4d34c42f38a75b0928ec6e625a3c98a16738f531 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 13 Jun 2022 22:23:34 +0000 Subject: [PATCH 05/16] remove whitespace --- heavy_script.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index 4ba89019..f8d87e8c 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -32,7 +32,6 @@ git fetch &> /dev/null } - help(){ [[ $help == "true" ]] && clear -x echo "Basic Utilities" From ca455cd9a5f916731f85fea9c5200d0a6e9fb440 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Tue, 14 Jun 2022 23:28:13 +0000 Subject: [PATCH 06/16] cleanup add git reset in the event a user chmod +x the script. remove continue from if statement.. it didn't do anything --- heavy_script.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index f8d87e8c..e0ae0adb 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -14,13 +14,14 @@ git fetch &> /dev/null [[ -n $(git diff --name-only origin/main | grep $SCRIPTNAME) ]] && { echo "Found a new version of HeavyScript, updating myself..." - git pull --force &> /dev/null + git reset --hard -q + git pull --force -q echo -e "Running the new version...\n" count=0 for i in "${args[@]}" do - [[ "$i" == "--self-update" ]] && unset "args[$count]" && break - ((count++)) + [[ "$i" == "--self-update" ]] && unset "args[$count]" && break + ((count++)) done sleep 5 exec bash "$SCRIPTNAME" "${args[@]}" @@ -57,7 +58,7 @@ echo "Examples" echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -vrsUp" echo "bash /mnt/tank/scripts/heavy_script.sh -t 150 --mount" echo "bash /mnt/tank/scripts/heavy_script.sh --dns" -echo "bash /mnt/tank/scripts/heavy_script.sh --restore" +echo "bash --restore" echo "bash /mnt/tank/scripts/heavy_script.sh --delete-backup" echo exit @@ -267,7 +268,7 @@ do else #user must not be using -S, just update echo -e "\n$app_name" [[ "$verbose" == "true" ]] && echo "Updating.." - cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo -e "Updated\n$old_full_ver\n$new_full_ver" && after_update_actions || { echo "FAILED"; continue; } + cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo -e "Updated\n$old_full_ver\n$new_full_ver" && after_update_actions || echo "FAILED" fi else echo -e "\n$app_name\nMajor Release, update manually" From 61b8ab3444c9f72f76de11b8f0d6d3f61ddc0956 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 22 Jun 2022 22:33:34 -0600 Subject: [PATCH 07/16] Typo in --help --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index e0ae0adb..3da300dd 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -58,7 +58,7 @@ echo "Examples" echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -vrsUp" echo "bash /mnt/tank/scripts/heavy_script.sh -t 150 --mount" echo "bash /mnt/tank/scripts/heavy_script.sh --dns" -echo "bash --restore" +echo "bash heavy_script.sh --restore" echo "bash /mnt/tank/scripts/heavy_script.sh --delete-backup" echo exit From e6966744861c680677ebf2829fba4543ad78c4bf Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:16:33 -0600 Subject: [PATCH 08/16] self update + regex fixes --- heavy_script.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index 3da300dd..4ef4d342 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -12,7 +12,7 @@ SCRIPTNAME="$0" cd $SCRIPTPATH git fetch &> /dev/null -[[ -n $(git diff --name-only origin/main | grep $SCRIPTNAME) ]] && { +if git diff --name-only origin/main | grep -q $SCRIPTNAME ; then echo "Found a new version of HeavyScript, updating myself..." git reset --hard -q git pull --force -q @@ -20,7 +20,7 @@ git fetch &> /dev/null count=0 for i in "${args[@]}" do - [[ "$i" == "--self-update" ]] && unset "args[$count]" && break + [[ "$i" == "--self-update" ]] && unset "args[$count]" && args+=("--updated") && break ((count++)) done sleep 5 @@ -28,11 +28,13 @@ git fetch &> /dev/null # Now exit this old instance exit - } - echo -e "HeavyScript is already the latest version.\n" +else + echo -e "HeavyScript is already the latest version\n" +fi } + help(){ [[ $help == "true" ]] && clear -x echo "Basic Utilities" @@ -217,7 +219,7 @@ export -f sync update_apps(){ -mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | grep -E ",true(,|$)" | sort) +mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | grep -E ",true(,|\b)" | sort) [[ -z $array ]] && echo -e "\nThere are no updates available" && return 0 || echo -e "\n${#array[@]} update(s) available" [[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout" [[ "$timeout" -le 120 ]] && echo "Warning: Your timeout is set low and may lead to premature rollbacks or skips" @@ -389,6 +391,9 @@ do delete-backup) deleteBackup="true" ;; + updated) + self_updated="true" + ;; *) echo -e "Invalid Option \"--$OPTARG\"\n" && help exit @@ -455,6 +460,7 @@ done #Continue to call functions in specific order [[ "$help" == "true" ]] && help +[[ $self_updated == "true" ]] && echo -e "HeavyScript has been updated\n" [[ "$self_update" == "true" ]] && self_update [[ "$deleteBackup" == "true" ]] && deleteBackup && exit [[ "$dns" == "true" ]] && dns && exit From 2b8a4f1593ecc76d32bc83979106ea262eb2f727 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:18:58 -0600 Subject: [PATCH 09/16] remove whitespace --- heavy_script.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index 4ef4d342..ab1282c4 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -34,7 +34,6 @@ fi } - help(){ [[ $help == "true" ]] && clear -x echo "Basic Utilities" From 31c1c7cd9b1d6a47d244a3a3c80e972bcf4fd357 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:20:40 -0600 Subject: [PATCH 10/16] quoting var --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index ab1282c4..f19bb3f5 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -459,7 +459,7 @@ done #Continue to call functions in specific order [[ "$help" == "true" ]] && help -[[ $self_updated == "true" ]] && echo -e "HeavyScript has been updated\n" +[[ "$self_updated" == "true" ]] && echo -e "HeavyScript has been updated\n" [[ "$self_update" == "true" ]] && self_update [[ "$deleteBackup" == "true" ]] && deleteBackup && exit [[ "$dns" == "true" ]] && dns && exit From 9241f27c2d9c91522e849c8ce0731c31be6f8162 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:29:29 -0600 Subject: [PATCH 11/16] quoting --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index f19bb3f5..71827226 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -12,7 +12,7 @@ SCRIPTNAME="$0" cd $SCRIPTPATH git fetch &> /dev/null -if git diff --name-only origin/main | grep -q $SCRIPTNAME ; then +if git diff --name-only origin/main | grep -q "$SCRIPTNAME" ; then echo "Found a new version of HeavyScript, updating myself..." git reset --hard -q git pull --force -q From d3fe6a6954a6645aad954f1c9a53ac276ccef508 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:35:32 -0600 Subject: [PATCH 12/16] fix self update --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index 71827226..42539763 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -8,7 +8,7 @@ args=("$@") self_update() { SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") -SCRIPTNAME="$0" +SCRIPTNAME="heavy_script.sh" cd $SCRIPTPATH git fetch &> /dev/null From 3eb9a1a28c8f4e8a76fbcec4f5ee8e09e6b80264 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:38:51 -0600 Subject: [PATCH 13/16] self update fixes --- heavy_script.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index 42539763..f35243d8 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -6,13 +6,13 @@ args=("$@") self_update() { -SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") -SCRIPTNAME="heavy_script.sh" -cd $SCRIPTPATH +script=$(readlink -f "$0") +script_path=$(dirname "$script") +script_name="heavy_script.sh" +cd "$script_path" || exit git fetch &> /dev/null -if git diff --name-only origin/main | grep -q "$SCRIPTNAME" ; then +if git diff --name-only origin/main | grep -q "$script_name" ; then echo "Found a new version of HeavyScript, updating myself..." git reset --hard -q git pull --force -q @@ -24,7 +24,7 @@ if git diff --name-only origin/main | grep -q "$SCRIPTNAME" ; then ((count++)) done sleep 5 - exec bash "$SCRIPTNAME" "${args[@]}" + exec bash "$script_name" "${args[@]}" # Now exit this old instance exit From 36f0c0b485675e5fb939737af106c95ef5c56c4e Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:45:22 -0600 Subject: [PATCH 14/16] remove updated --- heavy_script.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index f35243d8..1a3dcf2c 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -20,7 +20,7 @@ if git diff --name-only origin/main | grep -q "$script_name" ; then count=0 for i in "${args[@]}" do - [[ "$i" == "--self-update" ]] && unset "args[$count]" && args+=("--updated") && break + [[ "$i" == "--self-update" ]] && unset "args[$count]" && break ((count++)) done sleep 5 @@ -390,9 +390,6 @@ do delete-backup) deleteBackup="true" ;; - updated) - self_updated="true" - ;; *) echo -e "Invalid Option \"--$OPTARG\"\n" && help exit @@ -459,7 +456,6 @@ done #Continue to call functions in specific order [[ "$help" == "true" ]] && help -[[ "$self_updated" == "true" ]] && echo -e "HeavyScript has been updated\n" [[ "$self_update" == "true" ]] && self_update [[ "$deleteBackup" == "true" ]] && deleteBackup && exit [[ "$dns" == "true" ]] && dns && exit From 264fda6d121979552b62e91bf3f229bc9af76b91 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 06:52:09 -0600 Subject: [PATCH 15/16] force change --- heavy_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heavy_script.sh b/heavy_script.sh index 1a3dcf2c..8d38d6bf 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -464,4 +464,4 @@ done [[ "$number_of_backups" -ge 1 ]] && backup [[ "$sync" == "true" ]] && sync [[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && update_apps -[[ "$prune" == "true" ]] && prune +[[ "$prune" == "true" ]] && prune \ No newline at end of file From 319f65d7d65e49379a31565b45753b4725cc8225 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 20 Jul 2022 07:28:15 -0600 Subject: [PATCH 16/16] todo --- heavy_script.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/heavy_script.sh b/heavy_script.sh index 8d38d6bf..8f38bfad 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -218,6 +218,8 @@ export -f sync update_apps(){ +# Replace with line below after testing +# cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | tr -d " \t\r" | grep -E ",true($|,)" | sort mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | grep -E ",true(,|\b)" | sort) [[ -z $array ]] && echo -e "\nThere are no updates available" && return 0 || echo -e "\n${#array[@]} update(s) available" [[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout"