From 009abf2065c555925c1b3c5df7797a947faef72c Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 2 Apr 2022 03:01:25 +0300 Subject: [PATCH] more informative counter track on instance and fix point api --- funkwhale-cli.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 1af6733..8955ede 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -74,7 +74,13 @@ get_all_avalaible_count_tracks() { funkwhale_api_get_tracks 1 1>> /dev/null count_all_tracks=$(jj -i preload -l count) - echo "Tracks avalaible on $instance: $count_all_tracks\n" + if [ -z $count_all_tracks ]; then + echo 'Error: Connection error or API limit expired' + elif [ $count_all_tracks -eq 0 ]; then + echo 'Error: No tracks' + else + echo "Tracks avalaible on $instance: $count_all_tracks\n" + fi } get_all_avalaible_count_tracks @@ -115,7 +121,9 @@ elif [ "$choice" = "$changepod" ]; then echo "Type instance (ex. $instance):" read instance fi + export instance + export instance_point="https://$instance/api/v1" conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy) if [ "$conf_instance_state" = 'Permanent' ]; then jj -i config.json instance -v $instance -o config.json