JAIME_QUIROGA_1
Oct 08, 2014Nimbostratus
I wrote the script if you need put the irule in something virtual server, this is:
!/bin/bash
while read line
do
PART=`echo $line | awk -F ' ' '{print $1}'`
VIRTUAL=`echo $line | awk -F ' ' '{print $2}'`
VER=`tmsh show sys version | head -n5 | tail -n1 | awk '{ print $2}'`
if [ "$VER" == "11.5.1" ]; then {
HAB=`tmsh list ltm virtual /$PART/$VIRTUAL rules |grep Irule | awk '{ print $1}'`
if [ "$HAB" == '' ]; then {
echo "El virtual $VIRTUAL no tiene Irule $HAB"
tmsh modify ltm virtual /$PART/$VIRTUAL rules { Irule_Mitigacion_Vulnerabilidad }
} else {
echo "El virtual $VIRTUAL tiene estos Irule $HAB"
tmsh modify ltm virtual /$PART/$VIRTUAL rules { Irule_Mitigacion_Vulnerabilidad $HAB }
}
fi
tmsh modify ltm virtual /$PART/$VIRTUAL rules { Irule_Mitigacion_Vulnerabilidad }
}
elif [ "$VER" == "10.2.4" ]; then {
tmsh modify cli admin-partitions update-partition $PART
tmsh modify ltm virtual $VIRTUAL rules { Irule_Mitigacion_Vulnerabilidad }
}
fi
done