Skip to content
Snippets Groups Projects
Verified Commit c1f34b02 authored by Štěpán Henek's avatar Štěpán Henek :bear:
Browse files

diagnostics: new modules added

* certs
* cron
* firewall_turris
* processes
parent 17dc2340
No related branches found
No related tags found
1 merge request!9Resolve "Add script(s) for generating diagnostics"
help="
print info regarding certificates
"
if [ "$1" = "run" ] ; then
# print cz nic certificates
opkg info cznic-cacert-bundle
md5sum $(opkg files cznic-cacert-bundle | sed -n '1!p')
# print /etc/ssl/certs/
ls -nl /etc/ssl/certs/*.crt
ls -nl /etc/ssl/certs/*.crt | wc -l
ls -nl /etc/ssl/certs/*.0
ls -nl /etc/ssl/certs/*.0 | wc -l
# compare certs with symlinks
find /etc/ssl/certs/*.0 -exec readlink {} \; | sort > /tmp/diagnostics-certs-links
find /etc/ssl/certs/*.crt | xargs -n1 basename | sort > /tmp/diagnostics-certs-crts
diff /tmp/diagnostics-certs-links /tmp/diagnostics-certs-crts | grep '^>\|^<'
rm /tmp/diagnostics-certs-links /tmp/diagnostics-certs-crts
fi
help="
info about about the cron
"
if [ "$1" = "run" ] ; then
# is running
sh modules/processes.module run | grep cron | grep -v 'grep\|cron\.module\|diagnostics'
echo
# get the package info
opkg info $(opkg search "$(which cron)" | cut -d ' ' -f1)
# md5 + sizes of the files
grep '' /etc/cron.d/*
echo
# is cron enabled
find /etc/init.d/*cron* -exec md5sum {} \;
find /etc/rc.d/*cron* -exec md5sum {} \;
fi
help="
list turris firewall settings
"
if [ "$1" = "run" ] ; then
cat /etc/config/firewall-turris
echo
md5sum /usr/share/firewall/*
fi
help="
list running processes
"
if [ "$1" = "run" ] ; then
if ls $(which ps) | grep -q busybox ; then
ps w
else
ps aux
fi
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment