Forum Discussion
TimRiker
Cirrocumulus
Feb 08, 2019iControlREST replace iRule references on all virtual servers
I'm looking for a way to replace one iRule with another across all Virtual Servers on a given F5. The rule should preserve the order of the irules ie:
vs_example.com_HTTPS
irules before:
r...
TimRiker
Cirrocumulus
Feb 08, 2019Here's a script to do it with a reload:
#!/bin/sh
# replaceirule.sh
# replace references to one irule with references to another
# Tim Riker <Tim@Rikers.org>
if [ -z "$1" -o -z "$2" ] ; then
echo "Usage $0 oldrule newrule"
exit -1
fi
NOW=$(date +%Y%m%d%H%M)
tmsh save /sys config
echo "backing up to /config/bigip.conf.${NOW}"
cp -a /config/bigip.conf /config/bigip.conf.${NOW}
echo replacing $(grep -c "^ */Common/$1\$" bigip.conf) instances of $1 with $2
sed -e "s~^\( */Common\)/$1$~\1/$2~g" \
< /config/bigip.conf.${NOW} \
> /config/bigip.conf
echo "# test with this:"
echo "tmsh load /sys config verify"
echo "# do this if /config/bigip.conf looks good"
echo "tmsh load /sys config"Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
