Skip to content

Commit 63ca426

Browse files
Fixed missing import and improved script return information.
1 parent 05d21e0 commit 63ca426

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

webhooks.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
import hmac
1919
from hashlib import sha1
2020
from json import loads, dumps
21-
from ipaddress import ip_address, ip_network
2221
from shlex import split as shsplit
2322
from os import access, X_OK
2423
from os.path import isfile, abspath, normpath, dirname, join
2524

25+
import requests
26+
from ipaddress import ip_address, ip_network
2627
from flask import Flask, request, abort
2728

2829

@@ -92,9 +93,17 @@ def index():
9293
]
9394

9495
# Run scripts
96+
ran = {}
9597
for s in scripts:
9698
if isfile(s) and access(s, X_OK):
97-
call(
99+
ret = call(
98100
shsplit("{} '{}'".format(s, dumps(payload))),
99101
shell=True
100102
)
103+
ran[basename(s)] = ret
104+
105+
return ran
106+
107+
108+
if __name__ == '__main__':
109+
application.run(debug=True, host='0.0.0.0')

0 commit comments

Comments
 (0)