mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 00:31:00 -05:00
Remove unused stuff
This commit is contained in:
parent
553e13c057
commit
5cba023ff1
@ -1,6 +1,6 @@
|
||||
# Pointless stuff
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
docker-compose.*.yml
|
||||
.ncurc.json
|
||||
.env
|
||||
.mailmap
|
||||
@ -9,8 +9,6 @@ docker-compose.yml
|
||||
.github
|
||||
postgres-replica-stuff
|
||||
README.md
|
||||
ufwReject.sh
|
||||
|
||||
# Startup files
|
||||
startWithYarn.cjs
|
||||
botStartup.bat
|
||||
startDocker.sh
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
.env
|
||||
ips.txt
|
||||
# Yarn stuff
|
||||
.yarn
|
||||
# TypeScript stuff
|
||||
|
@ -1 +0,0 @@
|
||||
pm2 start startWithYarn.cjs --name Daggerbot
|
@ -1 +0,0 @@
|
||||
require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})
|
35
ufwReject.sh
35
ufwReject.sh
@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run this script as root or sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Store the IP addresses in a file
|
||||
IP_ADDRESSES_STORE="ips.txt"
|
||||
|
||||
# Scan the kernel log for IP addresses and store them in a file
|
||||
dmesg | grep 'SRC=' | awk -F'SRC=' '{ print $2 }' | awk '{ print $1 }' | sort | uniq | head -n 5000 > "$IP_ADDRESSES_STORE"
|
||||
|
||||
# Initialize a counter for new IPs
|
||||
new_ips=0
|
||||
|
||||
# Store the output of ufw status in a variable
|
||||
ufw_status=$(ufw status)
|
||||
|
||||
# Populate the UFW reject rule with the IP addresses collected from the kernel log
|
||||
while IFS= read -r ip
|
||||
do
|
||||
ip_prefix="${ip%.*}"
|
||||
# Check if the IP is already in the UFW rules
|
||||
if ! echo "$ufw_status" | grep -q "$ip" && [ "$ip_prefix" != "${TOAST_IP%.*}" ]
|
||||
then
|
||||
ufw reject from $ip
|
||||
# Increment the counter
|
||||
((new_ips++))
|
||||
fi
|
||||
done < "$IP_ADDRESSES_STORE"
|
||||
|
||||
echo "Done populating UFW reject rule"
|
||||
echo "$new_ips IP addresses were added"
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user