diff options
author | jaseg <git@jaseg.net> | 2019-03-27 18:28:57 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-03-27 18:28:57 +0900 |
commit | 874adce8f4efdda653c1e60d5b353a3bc816af93 (patch) | |
tree | f4926c974ee807ffbd60a08814341466f755f14b /gerboweb/deploy/vector.sh | |
parent | a006deb18830997529044e898282e2d9735b632d (diff) | |
download | gerbolyze-874adce8f4efdda653c1e60d5b353a3bc816af93.tar.gz gerbolyze-874adce8f4efdda653c1e60d5b353a3bc816af93.tar.bz2 gerbolyze-874adce8f4efdda653c1e60d5b353a3bc816af93.zip |
gerboweb: Initial commit
The functionality is there, no design yet
Diffstat (limited to 'gerboweb/deploy/vector.sh')
-rwxr-xr-x | gerboweb/deploy/vector.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gerboweb/deploy/vector.sh b/gerboweb/deploy/vector.sh new file mode 100755 index 0000000..5d239d5 --- /dev/null +++ b/gerboweb/deploy/vector.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +[ $# != 2 ] && exit 1 +ID=$1 +egrep -x -q '^[-0-9A-Za-z]{36}$'<<<"$ID" || exit 2 +LAYER=$2 +egrep -x -q '^(top|bottom)$'<<<"$LAYER" || exit 2 + +systemd-nspawn \ + -D /var/cache/gerbolyze_container \ + -x --bind=/var/cache/gerboweb/upload/$ID:/mnt \ + /bin/sh -c "set -euo pipefail +cd /tmp +unzip -j -d gerber_in /mnt/gerber.zip +gerbolyze vectorize $LAYER gerber_in gerber /mnt/overlay.png +rm -f /mnt/gerber_out.zip +zip -r /mnt/gerber_out.zip gerber" + |