github web hook php


        $sign = $_SERVER['HTTP_X_HUB_SIGNATURE'];
        list($type, $val) = explode("=", $sign, 2);
        $data = file_get_contents("php://input");
        $hash = hash_hmac($type, $data, "jnxGvjw[a/21eiuhas;lgw1b!b");

        if ($hash === $val) {
            echo shell_exec("cd /home/wwwroot/mini && sh pull.sh");
            exit;
        }
        echo 'err';


评论