You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
scriptform/examples/megacorp_acc/job_enable_firewall.sh

17 lines
449 B

#!/bin/sh
# FIXME: Validate ip address
if [ "$network" = "intra" ]; then
NETWORK="192.168.1.0/24"
elif [ "$network" = "machine" ]; then
NETWORK="192.168.1.12"
else
echo "Invalid network >&2"
exit 1
fi
echo "iptables -A INPUT -p tcp --source $ip_address --dest $NETWORK -j ACCEPT"
echo "echo \"iptables -A INPUT -p tcp --source $ip_address --dest $NETWORK -j ACCEPT\" | at now + $expire_days days"
echo
echo "Comment: ${comment}"