This commit is contained in:
Adnan Hajdarevic 2020-11-19 22:19:48 +01:00
parent 8431357269
commit 794a16ee13

View File

@ -23,31 +23,26 @@ _Make sure you have the `jq` command available, as we're using it to parse the J
<details> <details>
<summary>script.sh</summary> <summary>script.sh</summary>
```
#!/bin/bash #!/bin/bash
ip=$1 ip=$1
echo $ip >> ips.txt echo $ip >> ips.txt
```
</details> </details>
<details> <details>
<summary>prehook.sh</summary> <summary>prehook.sh</summary>
```
#!/bin/bash #!/bin/bash
context=$(cat) context=$(cat)
ip=`echo $context | jq -r '.remoteAddr' | cut -d ':' -f 1` ip=`echo $context | jq -r '.remoteAddr' | cut -d ':' -f 1`
echo "{\"ip\": \"$ip\"}" echo "{\"ip\": \"$ip\"}"
```
</details> </details>
<details> <details>
<summary>hooks.json</summary> <summary>hooks.json</summary>
```
[ [
{ {
"id": "log-ip", "id": "log-ip",
@ -58,5 +53,4 @@ _Make sure you have the `jq` command available, as we're using it to parse the J
] ]
} }
] ]
```
</details> </details>