You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
917 B

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