ipoctal: reset function istead of duplicate code

Signed-off-by: Federico Vaga <federico.vaga@cern.ch>