Skip to content

Commit

Permalink
checktrust: Add /usr/sbin/checktrust command
Browse files Browse the repository at this point in the history
Add a script to determine whether the system has lost the trust of other
systems. Query a few remote systems which are supposed to be online most
of the time.

Note, that this script has a tristate result (trusted, not trusted,
unknown) so we don't communicate the result via exit status, but output
"trusted", "not trusted" or nothing.
  • Loading branch information
donald committed Jul 9, 2020
1 parent de028ee commit cebbd07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions checktrust/checktrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/bash

for host in wtf afk pummelfee; do
reply="$(netcat -w 1 $host 236 </dev/null)"
if [ "$reply" = "I trust you" ]; then
echo "trusted"
exit
elif [ "$reply" = "I don't trust you" ]; then
echo "not trusted"
exit
fi
done
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ install_data misc_etc_files/rsyslog.conf "$DESTDIR$sysconfdir/rsyslog.conf"
install_data crashkernel/crashkernel.service "$DESTDIR$systemdunitdir/crashkernel.service"
install_exec crashkernel/crash-recovery.sh "$DESTDIR$root_sbindir/crash-recovery.sh"
install_data misc_systemd_units/admin-sshd.service "$DESTDIR$systemdunitdir/admin-sshd.service"
install_exec checktrust/checktrust "$DESTDIR$usr_sbindir/checktrust"
exit

0 comments on commit cebbd07

Please sign in to comment.