Skip to content

Instantly share code, notes, and snippets.

@eriktelepovsky
Created July 22, 2020 14:04
Show Gist options
  • Save eriktelepovsky/bfcb22a4c827676583a3275764adebb2 to your computer and use it in GitHub Desktop.
Save eriktelepovsky/bfcb22a4c827676583a3275764adebb2 to your computer and use it in GitHub Desktop.
DenyHosts
#! /usr/bin/env sh
set -eu
set -o pipefail
PID_FILE='/var/run/denyhosts.pid'
touch /var/log/denyhosts
tail -f -n 0 /var/log/denyhosts &
# Make sure the pid file isn't left over from a previous crashed instance
if [ -f "$PID_FILE" ]; then
echo 'Removing old PID file.'
rm -r "$PID_FILE"
fi
exec python /usr/bin/denyhosts.py --config /etc/denyhosts.conf --purge --sync --foreground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment