-
Notifications
You must be signed in to change notification settings - Fork 1
/
pull.php
executable file
·88 lines (81 loc) · 1.72 KB
/
pull.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/* This file automatically pulls the latest version of the site from the git
* repository. It requires that $USER be set up to pull the repo and that the
* following line exist in /etc/sudoers:
* www-data ALL=($USER) NOPASSWD: /usr/bin/git pull -v
* Where $USER is replaced with the specified value of $USER. Note that the
* parentheses must be there and are not for annotation purposes.
* */
$USER='duncan';
?>
<html>
<head>
<title>git pull</title>
<style>
.blinking-cursor {
-webkit-animation: 1s blink step-end infinite;
-moz-animation: 1s blink step-end infinite;
-ms-animation: 1s blink step-end infinite;
-o-animation: 1s blink step-end infinite;
animation: 1s blink step-end infinite;
-webkit-transform:scale(1.5, 1.0);
-moz-transform:scale(1.5, 1.0);
-ms-transform:scale(1.5, 1.0);
-o-transform:scale(1.5, 1.0);
transform:scale(1.5,1.0);
}
@keyframes "blink" {
from, to {
color: transparent;
}
50% {
color: green;
}
}
@-moz-keyframes blink {
from, to {
color: transparent;
}
50% {
color: green;
}
}
@-webkit-keyframes "blink" {
from, to {
color: transparent;
}
50% {
color: green;
}
}
@-ms-keyframes "blink" {
from, to {
color: transparent;
}
50% {
color: green;
}
}
@-o-keyframes "blink" {
from, to {
color: transparent;
}
50% {
color: green;
}
}
</style>
</head>
<body style="background-color:black;">
<pre style="color:#0f0;">
$ git pull -v
<?php
echo htmlspecialchars(shell_exec("sudo -u $USER /usr/bin/git pull -v 2>&1"));
?>
$ sh syntax.sh
<?php
echo htmlspecialchars(shell_exec("sudo -S true && sudo -u $USER /usr/bin/sh syntax.sh 2>&1"));
?>
$ <span class="blinking-cursor">|</span></pre>
</body>
</html>