-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (29 loc) · 1.38 KB
/
Copy pathindex.php
File metadata and controls
36 lines (29 loc) · 1.38 KB
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
<?php
/* require_once('teams.php');
require_once('names.php');
require_once('commands.php');
if (!isset($_GET['team']) || !array_key_exists($_GET['team'], $teams)) {
echo "Random Run: ".rand(101010, 999999)." Tau! Kaun si team ?";
exit(1);
}
if (!isset($_GET['project']) || !array_key_exists($_GET['project'], $teams[$_GET['team']])) {
echo "Random Run: ".rand(101010, 999999)." Tau! Kaun sa project ?";
exit(1);
}
if (!isset($_GET['repo']) || !in_array($_GET['repo'], $teams[$_GET['team']][$_GET['project']])) {
echo "Random Run: ".rand(101010, 999999)." Tau! Kaun si repo ?";
exit(1);
}
if (!isset($_GET['command']) || !in_array($_GET['command'], $commands)) {
echo "Random Run: ".rand(101010, 999999)." Tau! Kaun sa command ?";
exit(1);
}
$command = $_GET['command'];
echo 'sudo -u ubuntu /home/ubuntu/barelab/build.sh '.
$_GET['team'].' '.$_GET['project'].' '.$_GET["repo"].' '.$command.' &<br />'; */
exec('sudo -u devadmin /home/devadmin/git/build.sh', $output, $return_code);//.
// $_GET['team'].' '.$_GET['project'].' '.$_GET["repo"].' '.$command.' &', $output, $return_code);
echo "Random Run: ".rand(101010, 999999)." Return Code: ".$return_code."<br />";
foreach ($output as $id => $out)
echo "Line ".($id + 1).": ".$out."<br />";
?>