configure 792 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. source "${SNAP}/init"
  3. DOMAIN=`snapctl get domain`
  4. if [ -z "${DOMAIN}" ]; then
  5. DOMAIN="--not-set"
  6. else
  7. snapctl is-connected certs
  8. if [ $? -eq 0 ]; then
  9. HIT=`ls -Al "${SNAP_DATA}/certs/" | grep "${UUID}_${DOMAIN}" | wc -l`
  10. if [ "${HIT}" -eq 0 ]; then
  11. echo "No certificate available for"
  12. echo "Snap: ${SNAP_NAME}"
  13. echo "UUID: ${UUID}"
  14. echo "Domain: ${DOMAIN}"
  15. echo "See 'acme-sh' (snap install acme-sh)"
  16. DOMAIN="--not-set"
  17. fi
  18. else
  19. "Slot 'certs' not connected"
  20. echo "See 'acme-sh' (snap install acme-sh)"
  21. echo "then 'snap connect acme-sh:certs ${SNAP_DATA}:certs'"
  22. DOMAIN='--not-set'
  23. fi
  24. fi
  25. snapctl set domain="${DOMAIN}"