Fixed reboot logic & script conditional statement
Fixed IO redirection to log file