-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.php
59 lines (42 loc) · 1.46 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE HTML>
<?php include 'sidebar.php';?>
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/bootstrap.css"/>
</head>
<body id="bhome">
<div class="span9">
<div class="row-fluid">
<?php
if (file_exists('install.php') or file_exists('install-openvpn.php')){
echo "Please delete install files! (install.php and install-openvpn.php)";
}
$system_string = shell_exec("lsb_release -a"); //Seeing if the distro is debian
if ((strpos($system_string, 'Debian') !== false) or (strpos($system_string, 'Ubuntu') !== false)){ // Searching system string for "Debian"
echo "<br />";
echo "<font color='OOFFOO'>Okay!</font> Debian or Debian flavor found, checking status of openvpn...";
echo "<br />";
$ovpn_status = shell_exec("service openvpn status");
if (empty($ovpn_status)){
$ovpn_status = shell_exec("/etc/init.d/openvpn status");
}
echo $ovpn_status;
echo "<br />";
if (strpos($ovpn_status, 'not running') !== false){
echo "Openvpn is apparently not running...";
echo "<br />";
}
if (strpos($ovpn_status, 'is running') !== false){
echo "Openvpn appears to be running....";
echo "<br />";
}
}
?>
<!-- Body content -->
</div>
</div>
<!-- Required to have 2 divs at the end to close sidebar.php -->
</div>
</div>
</body>
</html>