aboutsummaryrefslogtreecommitdiff
path: root/base/qr
diff options
context:
space:
mode:
Diffstat (limited to 'base/qr')
-rwxr-xr-xbase/qr12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/qr b/base/qr
new file mode 100755
index 0000000..2de2dc9
--- /dev/null
+++ b/base/qr
@@ -0,0 +1,12 @@
+#!/bin/bash
+if [[ -f "$1" ]]; then
+ if file -bi "$1" | grep "^image/" &>/dev/null; then
+ OUTPUT="$(zbarimg -q "$1" | grep "^QR-Code:")"
+ if [[ $? -eq 0 ]]; then
+ echo "$OUTPUT" | tail -c+9
+ exit
+ fi
+ fi
+fi
+
+qrencode -t UTF8 $@