Implement -r function in script

The flag -r was assumed to be used for printing every ip for the most common
return code.