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