Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webhook-test-zsy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张思远
webhook-test-zsy
Commits
9f5e0311
Commit
9f5e0311
authored
Dec 21, 2023
by
张思远
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add liunux rmote
parent
5f9a4edf
Pipeline
#169
passed with stage
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
t1.sh
t1.sh
+3
-0
webhook.php
webhook.php
+30
-0
No files found.
t1.sh
0 → 100644
View file @
9f5e0311
#!/bin/bash
sshpass
-p
"Iwillbeback3"
ssh
-t
"www"
@8.140.51.18
"cd /www/wwwroot/webhook-test-zsy;git pull"
\ No newline at end of file
webhook.php
View file @
9f5e0311
...
@@ -42,4 +42,34 @@ if ($stderr) {
...
@@ -42,4 +42,34 @@ if ($stderr) {
echo
'</dl>'
;
echo
'</dl>'
;
echo
'linux远程:<br>'
;
$cmd
=
'bash t1.sh'
;
$descriptorspec
=
[
[
"pipe"
,
"r"
],
// stdin
[
"pipe"
,
"w"
],
// stdout
[
"pipe"
,
"w"
],
// stderr
];
$proc
=
proc_open
(
$cmd
,
$descriptorspec
,
$pipes
,
null
,
null
);
if
(
$proc
==
false
)
{
// do sth with HTTP response
}
else
{
$stdout
=
stream_get_contents
(
$pipes
[
1
]);
fclose
(
$pipes
[
1
]);
$stderr
=
stream_get_contents
(
$pipes
[
2
]);
fclose
(
$pipes
[
2
]);
$status
=
proc_close
(
$proc
);
// 释放proc
}
echo
'<dl>'
;
echo
'<dt>输出</dt>'
;
echo
'<dd><pre>'
.
$stdout
.
'</pre></dd>'
;
if
(
$stderr
)
{
// echo '<dt>出错了!</dt>';
echo
'<dd><pre>'
.
$stderr
.
'</pre></dd>'
;
}
echo
'</dl>'
;
exit
;
exit
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment