For IceCast servers: Yes, IceCast can instantly and automatically switch between the autoDJ and a live DJ whenever a live DJ connects or disconnects. This is described in the following article: How does the automatic live/autoDJ switching feature for IceCast work?
For ShoutCast servers: ShoutCast does not provide any functionality to notify Centova Cast when a live broadcast completes, so there is no way to have the autoDJ immediately restart after a live broadcast. As of v2.2.4, Centova Cast does include an option to detect sourceless streams as part of its cron job, and can automatically re-enable the autoDJ if it detects that no source is connected.
To enable this feature, set the "AUTODJ_FAILSAFE" option in /home/centovacast/system/config.php to "true". If you do not see an AUTODJ_FAILSAFE option, just add the following line to the config.php file:
define('AUTODJ_FAILSAFE',true);
Again, please note that Centova Cast only checks streams as part of its cron job, so there may be a delay of up to 5 minutes (depending on how often your cron job runs) before the autoDJ is reactivated.