53 lines
896 B

  1. #!/bin/bash
  2. if [ -z "$SERVICE_DATASTORE" ]; then
  3. echo "This script is meant to be run through 'compose' to work properly." >&2
  4. exit 1
  5. fi
  6. . /etc/shlib
  7. include parse
  8. include pretty
  9. . $CHARM_PATH/lib/common
  10. usage="
  11. $exname [-h|--help]
  12. $exname create MAIN_DOMAIN [DOMAINS..]
  13. $exname renew
  14. "
  15. if [ "$#" == 0 ]; then
  16. err "Please specify an action"
  17. print_usage
  18. exit 1
  19. fi
  20. while [ "$1" ]; do
  21. case "$1" in
  22. "--help"|"-h")
  23. print_usage
  24. exit 0
  25. ;;
  26. renew)
  27. exname="$exname $1"
  28. shift
  29. crt_renew "$@"
  30. exit $?
  31. ;;
  32. create)
  33. exname="$exname $1"
  34. shift
  35. crt_create "$@"
  36. exit $?
  37. ;;
  38. *)
  39. err "Wrong argument"
  40. print_usage
  41. exit 1
  42. ;;
  43. esac
  44. shift
  45. done