rc.conf + rc Script ==> get all related vars

Hi there,

I want to write a rc script. My rc.conf should hold information for it in following format:

Code:
md_enable="YES"
md_file_md0="/path/to/file-0"
md_file_md1="/path/to/file-1"
md_file_md2="/path/to/file-2"

Now I want something like this in my rc start script to find out about all "md_file_md" related variables:

Code:
for FILE in $md_file_md*; do
    echo $FILE
done

Obviuosly I could write something by the help of sed / awk to filter for md0, md1, md2, md[n] in rc.conf file ... but I was hoping the rc framework has somthing like this already? Or is there any better ideas of how to solve this easier?

Thanks
 
graudeejs said:
Why not to set
Code:
md_files="/path/to/file-0 /path/to/file-1 /path/to/file-2"
?

Thanks for your input. I thought about such a solution already but the issue is that this method would not relate md dev number with file definition ... So it is not really usable for my needs.
 
Back
Top