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.
17 lines
449 B
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}"
|
|
|