#!/bin/bash
# Script to prepare a host for using ssh_certificate scripts
# This script was generated by the utility certssh of the package ssh_certificate
# set -e
MYPROGNAME=`basename $0`
MYBUNDLE="ssh_certificate"
if [ "$1" == "initialize" ]
then
    sudo touch     /etc/ssh/revoked_hosts /etc/ssh/trusted_cas /etc/ssh/revoked_users /etc/ssh/ssh_known_hosts /etc/ssh/ssh_config /etc/ssh/sshd_config
    sudo chmod +rw /etc/ssh/ssh_known_hosts /etc/ssh/revoked_hosts /etc/ssh/trusted_cas /etc/ssh/revoked_users /etc/ssh/ssh_config /etc/ssh/sshd_config
    [ -s "/etc/ssh/ssh_known_hosts" ] ||  echo '# This comment is necessary to assure file is not zero length' | sudo tee -a /etc/ssh/ssh_known_hosts
else
cat <<EOF

Invoke this JUST ONCE on any host before beginning to use ${MYBUNDLE} scripts for the first time.
Its purpose is to initialize some /etc/ssh/ files to conform to assumptions in other ${MYBUNDLE} 
configuration scripts.

Use: ${MYPROGNAME} initialize
         To perform the initialization.

     ${MYPROGNAME}
          To display this information
EOF
fi


