<html>
<?php
session_start();

if((!isset ($_SESSION['login']) == true) and (!isset ($_SESSION['senha']) == true))
{
  unset($_SESSION['login']);
  unset($_SESSION['senha']);
  header('location:index.php');
}
?>



<script language="javascript" type="text/javascript">
    function Apache()
        {
            var x;
            var r=confirm("Deseja rebootar o serviço Apache agora?  ");
            if (r==true)
            {
                window.open('reboot_apache.php', 'principal');
            }
            else
            {
            
            }
            
        }
</script>

<script language="javascript" type="text/javascript">
    function Apache_reload()
        {
            var x;
            var r=confirm("Deseja recarregar o serviço Apache agora?  ");
            if (r==true)
            {
                window.open('reboot_apache.php', 'principal');
            }
            else
            {
            
            }
            
        }
</script>

<script language="javascript" type="text/javascript">
    function Bind()
        {
            var x;
            var r=confirm("Deseja rebootar o serviço Bind agora?  ");
            if (r==true)
            {
                window.open('reboot_bind.php', 'principal');
            }
            else
            {
            
            }
            
        }
</script>


<script language="javascript" type="text/javascript">
    function Bind_reload()
        {
            var x;
            var r=confirm("Deseja Recarregar o serviço Bind agora?  ");
            if (r==true)
            {
                window.open('reload_bind.php', 'principal');
            }
            else
            {
            
            }
            
        }
</script>


<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<script src="dist/jquery.slim.min.js"></script>
	<script src="dist/umd/popper.min.js"></script>
	<script src="bootstrap.bundle.min.js"></script>
    <title>Tools</title>
</head>
<body>
<form action="tools.php" method="get">

<h3>Status Serviço Bind:</h3>
<input class="form-control" type="text" name="apache" value="<?php echo shell_exec('systemctl status bind9 | egrep active');?>" id="apache" disabled style="display:block;">
<h6>
    <img src="images/icons/reboot.png" width=24 height=24><a href="#" onclick="Bind();"> Reboot Service</a> &nbsp; &nbsp;
    <img src="images/icons/reload.png" width=24 height=24><a href="#" onclick="Bind_reload();"> Reload Service</a>
</h6>

<br><br>

<h3>Status Serviço Apache:</h3>
<input class="form-control" type="text" name="bind" value="<?php echo shell_exec('/etc/init.d/apache2 status | grep active');?>" id="bind" disabled style="display:block;">
<h6>
    <img src="images/icons/reboot.png" width=24 height=24><a href="#" onclick="Apache();"> Reboot Service</a> &nbsp; &nbsp;
    <img src="images/icons/reload.png" width=24 height=24><a href="#" onclick="Apache_reload();"> Reload Service </a>
</h6>

<br><br>

</form>
</body>
</html>