Quick and dirty script to build files for USB update.
authorCameron Ball <c.ball1729@gmail.com>
Tue, 14 Apr 2015 15:42:38 +0000 (23:42 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Tue, 14 Apr 2015 15:43:01 +0000 (23:43 +0800)
.gitignore
make-dist.sh [new file with mode: 0644]

index 14a8b53..4767e77 100644 (file)
@@ -2,3 +2,5 @@
 hdmi-switcher
 video.mp4
 config.ini
+dist/
+private.pem
diff --git a/make-dist.sh b/make-dist.sh
new file mode 100644 (file)
index 0000000..698ae32
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash\r
+\r
+mkdir -p tmp/hdmi-switcher\r
+mkdir dist\r
+make\r
+cp hdmi-switcher tmp/hdmi-switcher\r
+cp start.sh tmp/hdmi-switcher\r
+cp update.sh tmp/hdmi-switcher\r
+cd tmp\r
+zip -r update hdmi-switcher\r
+cd ../\r
+mv tmp/update.zip dist\r
+rm -rf tmp\r
+\r
+if [ -f "private.pem" ]\r
+then\r
+    openssl dgst -sha256 -sign private.pem -out dist/update.sig dist/update.zip\r
+else\r
+    echo "Warning: Unable to sign file. Private key not found."\r
+fi
\ No newline at end of file