make this actually work as cgi-script
parent
aff67740f8
commit
dcaf1e7127
7
pyhi.sh
7
pyhi.sh
|
@ -4,10 +4,7 @@ if [ -z "$PYHP" ]; then
|
||||||
PYHP=""$(dirname "$0")"/pyhp.py"
|
PYHP=""$(dirname "$0")"/pyhp.py"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYH="$1"
|
HYPERTEXT=$("$PYHP" "$PYH" | python3 - "$PATH_TRANSLATED")
|
||||||
shift
|
|
||||||
|
|
||||||
HYPERTEXT=$("$PYHP" "$PYH" | python3 - "$@")
|
|
||||||
|
|
||||||
# check for headers, if present assume the pyh file is going to handle them
|
# check for headers, if present assume the pyh file is going to handle them
|
||||||
if head -n1 <<< "$HYPERTEXT" | grep "[A-Za-z][A-Za-z0-9\-]*: "; then
|
if head -n1 <<< "$HYPERTEXT" | grep "[A-Za-z][A-Za-z0-9\-]*: "; then
|
||||||
|
@ -16,4 +13,4 @@ else
|
||||||
echo -ne "Content-type: text/html\\n\\n"
|
echo -ne "Content-type: text/html\\n\\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$HYPERTEXT"
|
echo "$HYPERTEXT"
|
||||||
|
|
Loading…
Reference in New Issue