#!/usr/bin/env bash
# Script Author: Thomas Ward
# Script Title: Restart SSH, and HTTPds
#
# This script pushes out to all systems via Landscape.
# This script will force a restart of SSHd, and Apache or Nginx HTTPds
#
# This is to be run after security updates affecting OpenSSL.
if [ "$(lsb_release -r -s)" -eq "16.04" ] || [ "$(lsb_release -r -s)" -eq "15.10" ]; then
systemctl restart ssh
if [ -e /etc/init.d/apache2 ]; then
systemctl restart apache2
fi
if [ -e /etc/init.d/nginx ]; then
systemctl restart nginx
fi
else
service ssh restart
if [ -e /etc/init.d/apache2 ]; then
systemctl restart apache2
fi
if [ -e /etc/init.d/nginx ]; then
systemctl restart nginx
fi
fi