aboutsummaryrefslogtreecommitdiff
path: root/base/qr
blob: 2de2dc97986df966dfc638265ceff562bf7820aa (plain)
1
2
3
4
5
6
7
8
9
10
11
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 $@