#!/bin/bash

# Get include path. (http://stackoverflow.com/a/12694189)
dir="${BASH_SOURCE%/*}"
if [[ ! -d "$dir" ]]; then
    dir="$PWD"
fi

# Include functions.
source "$dir"/include.sh

# Make sure that we have permission.
check_root

# Make sure that iptables is actually installed.
check_software "iptables"

# Make sure that sshguard is installed.
check_software "sshguard"

# Add the sshguard chain and rule.
iptables -N sshguard
iptables -A TCP -p tcp --dport 22 -j sshguard

Create a new script to add sshguard to the chain.
Create a new script to add sshguard to the chain.

This comes from another option part of the guide on the wiki. The script
will not automatically install sshguard but it will check to make sure
that it is installed first. But, this will automatically open port 22
for SSH, which may not be exactly what is wanted.
