port checker, coredumpchecker
This commit is contained in:
parent
9565482b65
commit
a6e9b97b2a
20
bot.sh
20
bot.sh
|
@ -67,6 +67,26 @@ if [ "$?" -gt "0" ]; then
|
||||||
fi
|
fi
|
||||||
unset -f checkCert
|
unset -f checkCert
|
||||||
|
|
||||||
|
|
||||||
|
#check availablitiy of "forbidden" ports
|
||||||
|
curl 'http://mrbesen.de:9999' --output - -s > /dev/null
|
||||||
|
if [ "$?" -eq "0" ]; then
|
||||||
|
echo "9999 public!"
|
||||||
|
printf -v msg '%b\n\nport 9999 public iptable reules broken?' "${msg}"
|
||||||
|
ident="$ident:firewall"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# check for new coredumps
|
||||||
|
. coredumps.sh
|
||||||
|
checkCoreDump
|
||||||
|
if [ "$?" -ne "0" ]; then
|
||||||
|
echo "new coredump"
|
||||||
|
printf -v msg '%b\n\nnew coredump' "${msg}"
|
||||||
|
ident="$ident:coredump"
|
||||||
|
fi
|
||||||
|
unset -f checkCoreDump
|
||||||
|
|
||||||
. func.sh
|
. func.sh
|
||||||
if [[ "${#msg}" -gt "1" ]]; then
|
if [[ "${#msg}" -gt "1" ]]; then
|
||||||
#remove prepend
|
#remove prepend
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
function checkCoreDump {
|
||||||
|
SAVEFILE="coredumpcount"
|
||||||
|
coredumpcount=$(ls "/var/lib/systemd/coredump/" | wc -l)
|
||||||
|
lastcount=$(cat "${SAVEFILE}")
|
||||||
|
echo "${coredumpcount}" > "${SAVEFILE}"
|
||||||
|
if [ "$coredumpcount" -gt "${lastcount}" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
2
hdd.sh
2
hdd.sh
|
@ -4,5 +4,5 @@ function hddUsage {
|
||||||
}
|
}
|
||||||
|
|
||||||
function hddTop {
|
function hddTop {
|
||||||
du -hd 3 / --exclude="/proc" | sort -hr | grep -E "/.*/.*/" | head -n 3 | sed -e 's/\t/%20/g; s:/:%2F:g; a%0A' | sed -e '1i \%0A' | tr -d '\n'
|
du -hd 3 / --exclude="/proc" --exclude="/media" --exclude="/mnt" --exclude="/usr/local/bin/dchub/share" | sort -hr | grep -E "/.*/.*/" | head -n 3 | sed -e 's/\t/%20/g; s:/:%2F:g; a%0A' | sed -e '1i \%0A' | tr -d '\n'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue