1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-06 13:06:33 +00:00

Changes for new Linux distributions: grep -E, -F

This commit is contained in:
Gerhard Rieger 2024-06-29 09:45:16 +02:00
parent 2ab4b232fc
commit 54cbb0bb09
4 changed files with 10 additions and 8 deletions

View file

@ -39,13 +39,13 @@ done
# read and parse HTTP request
read l
if ! echo "$l" |egrep '^CONNECT +[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+ +HTTP/[1-3].[0-9]$' >/dev/null
if ! echo "$l" |grep -E '^CONNECT +[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+ +HTTP/[1-3].[0-9]$' >/dev/null
then
echo "HTTP/1.0${SPACES}500 Bad Request"
echo
exit
fi
if ! echo "$l" |egrep '^CONNECT +[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+ +HTTP/'"$REQVER"'$' >/dev/null
if ! echo "$l" |grep -E '^CONNECT +[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+ +HTTP/'"$REQVER"'$' >/dev/null
then
echo "HTTP/1.0${SPACES}426 Upgrade Required"
echo