gen-qr.sh 482 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. key_base64=$(uci get fwknopd.@access[0].KEY_BASE64)
  3. key=$(uci get fwknopd.@access[0].KEY)
  4. hmac_key_base64=$(uci get fwknopd.@access[0].HMAC_KEY_BASE64)
  5. hmac_key=$(uci get fwknopd.@access[0].HMAC_KEY)
  6. if [ $key_base64 != "" ]; then
  7. qr="KEY_BASE64:$key_base64"
  8. fi
  9. if [ $key != "" ]; then
  10. qr="$qr KEY:$key"
  11. fi
  12. if [ $hmac_key_base64 != "" ]; then
  13. qr="$qr HMAC_KEY_BASE64:$hmac_key_base64"
  14. fi
  15. if [ $hmac_key != "" ]; then
  16. qr="$qr HMAC_KEY:$hmac_key"
  17. fi
  18. qrencode -o - "$qr"