freedombone-xmpp-pass 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # Changes the password for an XMPP user
  12. # License
  13. # =======
  14. #
  15. # Copyright (C) 2015 Bob Mottram <bob@robotics.uk.to>
  16. #
  17. # This program is free software: you can redistribute it and/or modify
  18. # it under the terms of the GNU General Public License as published by
  19. # the Free Software Foundation, either version 3 of the License, or
  20. # (at your option) any later version.
  21. #
  22. # This program is distributed in the hope that it will be useful,
  23. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. # GNU General Public License for more details.
  26. #
  27. # You should have received a copy of the GNU General Public License
  28. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. EMAIL_ADDRESS=
  30. function show_help {
  31. echo ''
  32. echo 'freedombone-xmpp-pass -e [email address]'
  33. echo ''
  34. exit 0
  35. }
  36. while [[ $# > 1 ]]
  37. do
  38. key="$1"
  39. case $key in
  40. -h|--help)
  41. show_help
  42. ;;
  43. -e|--email)
  44. shift
  45. EMAIL_ADDRESS="$1"
  46. ;;
  47. *)
  48. # unknown option
  49. ;;
  50. esac
  51. shift
  52. done
  53. if [ ! $EMAIL_ADDRESS ]; then
  54. show_help
  55. fi
  56. prosodyctl passwd $EMAIL_ADDRESS
  57. exit 0