Sh3ll



Directory :  /scripts2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Current File : //scripts2/alert-firewall-linux.sh
#!/bin/bash

SERVICE="csf"

EMAIL="sysadmin@sitioshispanos.com"

HOSTNAME=`hostname`

EXCLUDE="dns" #e.g. linux{58,{91..95},97} = linux58, linux91-95, linux97

for linuxhost in `eval echo $EXCLUDE.webhosting-network-services.com`
do
  if [ $HOSTNAME == $linuxhost ]; then
    exit 0
  fi
done

if systemctl is-active $SERVICE; then
  exit 0
else
  systemctl status $SERVICE | mail -s "Firewall down on $HOSTNAME ($SERVICE)" $EMAIL
fi

Sh3LL