summaryrefslogtreecommitdiffabout
path: root/scripts/xml2sh.xsl
authorMichael Krelin <hacker@klever.net>2009-03-08 20:09:21 (UTC)
committer Michael Krelin <hacker@klever.net>2009-03-08 20:09:21 (UTC)
commitaadaa8b5d7eda23e72dbded9d6437b40358353f3 (patch) (side-by-side diff)
tree0bff6fdde1e2b9be02b48aaf7d03f095604718e1 /scripts/xml2sh.xsl
downloadiii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.zip
iii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.tar.gz
iii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.tar.bz2
Inital commit to public repository0.0
Diffstat (limited to 'scripts/xml2sh.xsl') (more/less context) (show whitespace changes)
-rw-r--r--scripts/xml2sh.xsl28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/xml2sh.xsl b/scripts/xml2sh.xsl
new file mode 100644
index 0000000..736bc21
--- a/dev/null
+++ b/scripts/xml2sh.xsl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ >
+ <xsl:output
+ method="text"
+ encoding="us-ascii"
+ media-type="text/plain" />
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="/Config/Cards/Card"/>
+ </xsl:template>
+
+ <xsl:template match="/Config/Cards/Card">
+ <xsl:text>cat &gt;</xsl:text>
+ <xsl:value-of select="translate(@MacAddress,'-','')"/>
+ <xsl:text>.conf &lt;&lt;__EOF__&#xa;</xsl:text>
+ <xsl:text>uploadkey=&quot;</xsl:text>
+ <xsl:value-of select="UploadKey"/>
+ <xsl:text>&quot;&#xa;</xsl:text>
+ <xsl:text>targetdir=&quot;/var/lib/iii/%s&quot;&#xa;</xsl:text>
+ <xsl:text>umask=022&#xa;</xsl:text>
+ <xsl:text>__EOF__&#xa;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="*|text()"/>
+
+</xsl:stylesheet>