@startuml

start

:input: device to restart;

:process: get mac-address, switch and port from database;

:process: searching for mac-address on switchport;

if (mac-address is found) then (true)
    :process: restart device;
else (false)
    :process: searching for mac-address in network;
    if (mac-address is found) then (true)
        :process: restart device;
        :process: update database;
    else (false)
        :pocess: restart device (with old data);
    endif
endif

while(device reachable?) is (false)

endwhile (true)

:output: true;

stop

@enduml