4 203
modifications
Ligne 67 : | Ligne 67 : | ||
iptables -A morales -s $2 -j DROP | iptables -A morales -s $2 -j DROP | ||
if [ "$?" = "0" ]; then | if [ "$?" = "0" ]; then | ||
echo $2 >> | echo "$2" >> /root/iptables/banned.list | ||
echo "Added $2" | echo "Added $2" | ||
exit 0 | exit 0 | ||
Ligne 83 : | Ligne 83 : | ||
iptables -D morales -s $2 -j DROP | iptables -D morales -s $2 -j DROP | ||
if [ "$?" = "0" ]; then | if [ "$?" = "0" ]; then | ||
sed /$2/d $ | sed /$2/d "$banned_file" > "$banned_file".tmp | ||
mv $ | mv "$banned_file".tmp "$banned_file" | ||
echo "Removed $2" | echo "Removed $2" | ||
exit 0 | exit 0 |