summaryrefslogtreecommitdiff
path: root/zerotierone/controller/schema2c.sh
diff options
context:
space:
mode:
Diffstat (limited to 'zerotierone/controller/schema2c.sh')
-rwxr-xr-xzerotierone/controller/schema2c.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/zerotierone/controller/schema2c.sh b/zerotierone/controller/schema2c.sh
new file mode 100755
index 0000000..4f4f164
--- /dev/null
+++ b/zerotierone/controller/schema2c.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Run this file to package the .sql file into a .c file whenever the SQL changes.
+
+rm -f schema.sql.c
+echo '#define ZT_NETCONF_SCHEMA_SQL \' >schema.sql.c
+cat schema.sql | sed 's/"/\\"/g' | sed 's/^/"/' | sed 's/$/\\n"\\/' >>schema.sql.c
+echo '""' >>schema.sql.c