Browse Source

Command to change the xmpp password

Bob Mottram 10 years ago
parent
commit
2112266e94
4 changed files with 71 additions and 0 deletions
  1. 4
    0
      Makefile
  2. 1
    0
      debian/source/include-binaries
  3. BIN
      man/freedombone-xmpp-pass.1.gz
  4. 66
    0
      src/freedombone-xmpp-pass

+ 4
- 0
Makefile View File

@@ -26,6 +26,7 @@ install:
26 26
 	install -m 755 src/${APP}-unignore ${DESTDIR}${PREFIX}/bin
27 27
 	install -m 755 src/${APP}-addxmpp ${DESTDIR}${PREFIX}/bin
28 28
 	install -m 755 src/${APP}-rmxmpp ${DESTDIR}${PREFIX}/bin
29
+	install -m 755 src/${APP}-xmpp-pass ${DESTDIR}${PREFIX}/bin
29 30
 	mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1
30 31
 	install -m 644 man/${APP}.1.gz ${DESTDIR}${PREFIX}/share/man/man1
31 32
 	install -m 644 man/${APP}-prep.1.gz ${DESTDIR}${PREFIX}/share/man/man1
@@ -43,6 +44,7 @@ install:
43 44
 	install -m 644 man/${APP}-unignore.1.gz ${DESTDIR}${PREFIX}/share/man/man1
44 45
 	install -m 644 man/${APP}-addxmpp.1.gz ${DESTDIR}${PREFIX}/share/man/man1
45 46
 	install -m 644 man/${APP}-rmxmpp.1.gz ${DESTDIR}${PREFIX}/share/man/man1
47
+	install -m 644 man/${APP}-xmpp-pass.1.gz ${DESTDIR}${PREFIX}/share/man/man1
46 48
 uninstall:
47 49
 	rm -f ${PREFIX}/share/man/man1/${APP}.1.gz
48 50
 	rm -f ${PREFIX}/share/man/man1/${APP}-prep.1.gz
@@ -60,6 +62,7 @@ uninstall:
60 62
 	rm -f ${PREFIX}/share/man/man1/${APP}-unignore.1.gz
61 63
 	rm -f ${PREFIX}/share/man/man1/${APP}-addxmpp.1.gz
62 64
 	rm -f ${PREFIX}/share/man/man1/${APP}-rmxmpp.1.gz
65
+	rm -f ${PREFIX}/share/man/man1/${APP}-xmpp-pass.1.gz
63 66
 	rm -rf ${PREFIX}/share/${APP}
64 67
 	rm -f ${PREFIX}/bin/${APP}
65 68
 	rm -f ${PREFIX}/bin/${APP}-prep
@@ -76,6 +79,7 @@ uninstall:
76 79
 	rm -f ${PREFIX}/bin/${APP}-unignore
77 80
 	rm -f ${PREFIX}/bin/${APP}-addxmpp
78 81
 	rm -f ${PREFIX}/bin/${APP}-rmxmpp
82
+	rm -f ${PREFIX}/bin/${APP}-xmpp-pass
79 83
 clean:
80 84
 	rm -f \#* \.#* debian/*.substvars debian/*.log
81 85
 	rm -fr deb.* debian/${APP}

+ 1
- 0
debian/source/include-binaries View File

@@ -14,3 +14,4 @@ man/freedombone-ignore.1.gz
14 14
 man/freedombone-unignore.1.gz
15 15
 man/freedombone-addxmpp.1.gz
16 16
 man/freedombone-rmxmpp.1.gz
17
+man/freedombone-xmpp-pass.1.gz

BIN
man/freedombone-xmpp-pass.1.gz View File


+ 66
- 0
src/freedombone-xmpp-pass View File

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