Forum Discussion
ifile default location of imported files
Hi Basil,
you can lookup the iFile location on your harddisks by using the command below...
[itacs@f5-test:Active:Standalone] ~ find / -name "*MyiFileName*"
But its not possible to change the iFile in the background, since they are referenced within your configuration using a version number including a MD5 hash. If you try to change them directly you will most likely destroy the iFiles on the next configuration load.
I would recommend to export all your iFiles from the device (via SCP). Edit them as needed. Rename them 1:1 to match the name of the iFile file object and upload every ifile back to e.g.
/ifiles/*.
The use a TMSH script to enumerate every iFile file object and update every single iFile configuration using the
source-path file:/ifiles/$ifile_name option.
You may use the script below as a starting point...
update_ifiles.tcl
proc script::run {} {
foreach ifile [tmsh::get_config /sys file ifile] {
set ifile_name [tmsh::get_name $ifile]
if { [catch {
eval "tmsh::modify /sys file ifile $ifile_name \{ source-path file:/ifiles/$ifile_name \}"
puts "iFile Update: Successfully updated iFile : $ifile_name"
}] } then {
puts "iFile Update: Failed to update iFile : $ifile_name"
}
}
}
TMSH script execution
[itacs@f5-02:Active:Standalone] / tmsh run cli script file /script_path/update_ifiles.tcl
iFile Update: Successfully updated iFile : MyiFile
iFile Update: Successfully updated iFile : iFileTest
curl: (37) Couldn't open file :/ifiles/iFileTest2
iFile Update: Failed to update iFile : iFileTest2
Note: If a given iFile is not found within the /ifiles/ directory its getting ignored. So you could also export/change/modify just a subset of your iFiles...
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
