I have an xml config file:
<icecast>
<mount>
<mount-name>/yourradio.mp3</mount-name>
<accesslog>
<name>/access/yourradio/yourradiomp3.log</name>
<duration>86400</duration>
<archive>true</archive>
<size>20000000</size>
</accesslog>
</mount>
<mount>
<mount-name>/aire.mp3</mount-name>
<accesslog>
<name>/access/yourradio/yourradiomp3.log</name>
<duration>86400</duration>
<archive>true</archive>
<size>20000000</size>
</accesslog>
</mount>
</icecast>
How can I sort this in alphabetic order using the <mount-name>
as the sorting element and output it back into xml. I have seen you can do some stuff with xmllint using a xslt but I cant seem to get my head around it and get it to work.
Ideally would love to be able to run this in a bash script to then sort all of the mounts I have in a configuration file.
Thank you for all of your help!