i found the solution to restart the hamachi service making an script, you can find more info here: https://www.linuxquestions.org/questions/linux-networking-3/script-to-check-connection-and-restart-network-if-down-262281/
Just swap google.com with one of the device on the network that you know is 24/7 online and swap service network restart for sudo /etc/init.d/logmein-hamachi restart that will restart the hamachi service if it cant reach the network.
Just swap google.com with one of the device on the network that you know is 24/7 online and swap service network restart for sudo /etc/init.d/logmein-hamachi restart that will restart the hamachi service if it cant reach the network.