Skip to content

Commit f9b596f

Browse files
authored
Format shell scripts (#3590)
1 parent debbe94 commit f9b596f

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout default.key -out default.crt -subj "/CN=NGINXIngressController"
4-
cat default.key default.crt > default.pem
4+
cat default.key default.crt >default.pem
55
rm default.key default.crt

hack/docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash
1+
#!/usr/bin/env bash
22

33
git_commit=$1
44
git_tag=$2

hack/prepare-major-release.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
DOCS_TO_UPDATE_FOLDER=docs/content
1212

13-
if [ $# != 4 ];
14-
then
13+
if [ $# != 4 ]; then
1514
echo "Invalid number of arguments" 1>&2
1615
echo "Usage: $0 prev_ic_version ic-version prev_helm_chart_version helm-chart-version" 1>&2
1716
exit 1

hack/verify-codegen.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ echo "diffing ${DIFFROOT} against freshly generated codegen"
3939
ret=0
4040
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
4141
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
42-
if [[ $ret -eq 0 ]]
43-
then
42+
if [[ $ret -eq 0 ]]; then
4443
echo "${DIFFROOT} up to date."
4544
else
4645
echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh"

tests/data/dos/bad_clients_xff.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
2+
23
HOST=$1
34
IP_AND_PORT=$2
45
URI='bad_path.html'
56
NUM=600
67
CONNS=300
78
while true; do
8-
echo "ab -l -n ${NUM} -c ${CONNS} -d -s 5 \
9+
echo "ab -l -n ${NUM} -c ${CONNS} -d -s 5 \
910
-H "Host: ${HOST}" \
1011
-H "X-Forwarded-For: 1.1.1.1" \
1112
${IP_AND_PORT}${URI}"

tests/data/dos/good_clients_xff.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
23
HOST=$1
34
IP_AND_PORT=$2
45
URI='good_path.html'
56

6-
7-
declare -a array=("/faq.php?sid=e6106109db52fec6127b73b152224dea#f4r0"
8-
"/styles/prosilver/theme/print.css"
9-
"/styles/prosilver/theme/images/bg_header.gif"
10-
"/styles/prosilver/template/styleswitcher.js")
11-
7+
declare -a array=(
8+
"/faq.php?sid=e6106109db52fec6127b73b152224dea#f4r0"
9+
"/styles/prosilver/theme/print.css"
10+
"/styles/prosilver/theme/images/bg_header.gif"
11+
"/styles/prosilver/template/styleswitcher.js"
12+
)
1213

1314
while true; do
14-
URI=${array[$(( RANDOM % 3 ))]}
15+
URI=${array[$((RANDOM % 3))]}
1516
echo ${HOST}
1617
echo ${IP_AND_PORT}
1718
echo 'curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" -H "Host: ${HOST}" -H "X-Forwarded-For: 3.3.3.2" ${IP_AND_PORT}${URI}'
18-
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" -H "Host: ${HOST}" -H "X-Forwarded-For: 3.3.3.2" ${IP_AND_PORT}${URI} &
19-
URI=${array[$(( RANDOM % 3 ))]}
20-
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" -H "Host: ${HOST}" -H "X-Forwarded-For: 31.212.17.19" ${IP_AND_PORT}${URI} &
21-
URI=${array[$(( RANDOM % 3 ))]}
22-
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" -H "Host: ${HOST}" -H "X-Forwarded-For: 46.117.23.157" ${IP_AND_PORT}${URI} &
19+
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" -H "Host: ${HOST}" -H "X-Forwarded-For: 3.3.3.2" ${IP_AND_PORT}${URI} &
20+
URI=${array[$((RANDOM % 3))]}
21+
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" -H "Host: ${HOST}" -H "X-Forwarded-For: 31.212.17.19" ${IP_AND_PORT}${URI} &
22+
URI=${array[$((RANDOM % 3))]}
23+
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" -H "Host: ${HOST}" -H "X-Forwarded-For: 46.117.23.157" ${IP_AND_PORT}${URI} &
2324

24-
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" -H "Host: ${HOST}" -H "X-Forwarded-For: 111.212.17.19" ${IP_AND_PORT}
25+
curl -b cookiefile -c cookiefile -L -s -o /dev/null -w "%{http_code}\n" -m 10 --connect-timeout 5 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" -H "Host: ${HOST}" -H "X-Forwarded-For: 111.212.17.19" ${IP_AND_PORT}
2526

2627
killall curl
2728
sleep 0.2

0 commit comments

Comments
 (0)