/**
 *	@author João Reis
 *	@Year 2016
 *	@param $
 *	@return
 */
function _reinstalarServidor($Id)
{
    try {
        _apagarServidor();
        _instalarServidor();
    } catch (Exception $e) {
        return false;
    }
}
 /**
  *	@author João Reis
  *	Elimina Servidor na base de dados e respetivos ficheiros.
  *	@return Boolean
  */
 function eliminar()
 {
     /*
     try
     {
     	$this->executaComando("sudo rm /home/cyberpanel/".$this->Id."/* -R");
     	eliminarServidorById($this->Id);
     	return true;
     }
     catch(Exception $ex)
     {
     	return false;
     }
     */
     @(include "modulos/modulos.conf.php");
     @(include "../modulos/modulos.conf.php");
     #@include_once(__DIR__."/modulos/modulos.conf.php");
     $existe = false;
     $index = 1;
     $i = 0;
     if (isset($Vmodulos)) {
         $modulos = array();
         $modulos = $Vmodulos;
         foreach ($modulos as $modulo) {
             $i++;
             if ($modulo['tipoServidor'] == $this->getTipoServidor()) {
                 $existe = true;
                 $index = $i;
                 break;
             }
         }
         if ($existe) {
             if (function_exists('_apagarServidor')) {
                 return _apagarServidor($this->Id);
             } else {
                 include $modulos[$index]['dir'];
                 include "../" . $modulos[$index]['dir'];
                 if (isset($modulos)) {
                     return _apagarServidor($this->Id);
                 }
                 return false;
             }
         } else {
             return false;
         }
     }
 }