commander func

This commit is contained in:
Heavybullets8 2022-07-24 22:11:04 -06:00
parent a0104e65e2
commit 63ec2b586a
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
commander(){
mapfile -t array < <(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' | tr -d " \t\r" | grep -E ",true($|,)" | sort)
[[ -z $array ]] && echo -e "\nThere are no updates available" && return 0 || echo -e "\n${#array[@]} update(s) available" [[ -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" [[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout"
@ -18,7 +18,8 @@ count=0
wait wait
done done
done done
}
export -f commander
update_apps(){ update_apps(){
app_name=$(echo "$i" | awk -F ',' '{print $1}') #print out first catagory, name. app_name=$(echo "$i" | awk -F ',' '{print $1}') #print out first catagory, name.

View File

@ -115,5 +115,5 @@ done
[[ "$mount" == "true" ]] && mount && exit [[ "$mount" == "true" ]] && mount && exit
[[ "$number_of_backups" -ge 1 ]] && backup [[ "$number_of_backups" -ge 1 ]] && backup
[[ "$sync" == "true" ]] && sync [[ "$sync" == "true" ]] && sync
[[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && update_apps [[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && commander
[[ "$prune" == "true" ]] && prune [[ "$prune" == "true" ]] && prune