#!/bin/bash cd /www/wwwroot/xxx.xxxxx.com git fetch --all git reset --hard origin/master git pull https://username:/xxx/xxx.git master
namespace app\index\controller; use think\facade\Request; class Hooks { public function hook(){ $request = Request::instance(); $params = $request->param(); $pwd = $params['password']; if($pwd == '3'){ $command = '/www/wwwroot/xxx.xxxxx.com/update.sh'; chown($command,'www'); chmod($command,0755); exec($command,$output); return json(['code'=>200,'msg'=>'远程更新成功','data'=>$output]); }else{ return json(['code'=>300,'msg'=>'更新失败','data'=>[]]); } } }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/220952.html原文链接:https://javaforall.net
