We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 391f607 commit cec8e49Copy full SHA for cec8e49
1 file changed
bin/updatehoneypotip.sh
@@ -8,13 +8,17 @@ if [ ! "$userid" = "0" ]; then
8
exit 9
9
fi
10
11
-if [ ! -f /etc/dshield.ini ]; then
12
- echo "missing /etc/dshield.ini file"
+if [ ! -f /srv/dshield/etc/dshield.ini ]; then
+ echo "missing /srv/dshield/etc/dshield.ini file"
13
14
15
honeypotip=$(curl -s https://www4.dshield.org/api/myip?json | jq .ip | tr -d '"')
16
if echo -n $honeypotip | egrep -q '^[0-9\.]+$'; then
17
- sed -i "s/^honeypotip=.*/honeypotip=$honeypotip/" /etc/dshield.ini
+ sed -i "s/^honeypotip=.*/honeypotip=$honeypotip/" /srv/dshield/etc/dshield.ini
18
+ if ! grep -q '^piid=' dshield.ini; then
19
+ piid=$(openssl rand -hex 10)
20
+ sed -i "^apikey/a piid=$piid" /srv/dshield/etc/dshield.ini
21
+ fi
22
else
23
echo "Bad IP address"
24
0 commit comments