a h@sddlZddlmZddlZddlmZmZmZmZej ddddZ ej eded d d Z ej e ed d dZej eedddZed ed ddZed ed ddZdS)N)Callable)greenredboldyellow)filercodecOs"t|t|d|t|dSN)colorr) color_printrsysexit)rr argskwargsr./opt/support/lib/output.pyerr_exitsr)rr r cOst|||d|dSr r )rr rrrrrwarn sripaddrZlistedwherecCs,td||rtdntdd|dS)z0For printing whether an IP is listed in iptableszThe IP z is listedz is not listedzin N)printrrrrrr print_listeds r)rjailportscCs8d|vrd}n d|}td|dt|tddS)NZALLz ALL portszports z)Automatically blocked by fail2ban in the z jail on r)rrr)rrrZ blocked_onrrrprint_fail2ban_listeds rcOst|d|i|dS)Nr r)r rrrrrheader$srcOs6||}t|tr$t|fi|nt|i|dS)N) isinstancestrr)r rroutrrrr (s r )r typingrZnetaddrZ rads.colorrrrrstderrrrZ IPAddressboolr!rrrr rrrrs