Implemented ip_availability script

Fixes RM3994

Depends on config quark.ipam_reuse_after and database.connection.