Update Template Validity

Problem this snippet solves:

After TMOS version upgrade or iApp template file upgrade usually all iApps created from templates shows warning flag "Source Template Has Changed". You can reset this flag from GUI opening each changed iApp and manually saving configuration. Another way is to use TMSH command "modify /sys application service $APP_NAME execute-action definition". But what if you have several partitions with multiply iApps configured. This process could steal too much time.

This TMSH alias allows you to easily update all configured iApps in all partitions which configuration has changed after template or TMOS upgrade.

How to use this snippet:

Just call TMSH alias "app_update" and watch which iApps will be fixed

Code :

create cli alias shared app_update { command "run /util bash -c \"app_list=$(tmsh -q -c 'list sys application service recursive /* { template-modified }' | grep -B 1 'template-modified yes' | grep 'sys application service' | awk '{print $4}'); for app in $app_list; do echo -n 'Updating application '; echo $app; tmsh modify /sys application service $app execute-action definition; done\"" }

Tested this on version:

13.0
Published Apr 12, 2018
Version 1.0

Was this article helpful?

No CommentsBe the first to comment