Quellcode durchsuchen

Move xmpp user removal into the app script

Bob Mottram vor 7 Jahren
Ursprung
Commit
e5cff004fe
2 geänderte Dateien mit 6 neuen und 75 gelöschten Zeilen
  1. 6
    4
      src/freedombone-app-xmpp
  2. 0
    71
      src/freedombone-rmxmpp

+ 6
- 4
src/freedombone-app-xmpp Datei anzeigen

@@ -202,13 +202,15 @@ function configure_interactive_xmpp {
202 202
 
203 203
 function remove_user_xmpp {
204 204
     remove_username="$1"
205
-    ${PROJECT_NAME}-pass -u $remove_username --rmapp xmpp
206
-    XMPP_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_xmpp/hostname)
205
+
206
+    ${PROJECT_NAME}-pass -u "$remove_username" --rmapp xmpp
207 207
     if [[ $ONION_ONLY != "no" ]]; then
208
-        ${PROJECT_NAME}-rmxmpp -e "${remove_username}@${XMPP_ONION_HOSTNAME}"
208
+        DOMAIN=$(cat /var/lib/tor/hidden_service_xmpp/hostname)
209 209
     else
210
-        ${PROJECT_NAME}-rmxmpp -e "${remove_username}@${HOSTNAME}"
210
+        DOMAIN=${HOSTNAME}
211 211
     fi
212
+    prosodyctl deluser "${remove_username}@${DOMAIN}"
213
+
212 214
 }
213 215
 
214 216
 function add_user_xmpp_client {

+ 0
- 71
src/freedombone-rmxmpp Datei anzeigen

@@ -1,71 +0,0 @@
1
-#!/bin/bash
2
-#
3
-# .---.                  .              .
4
-# |                      |              |
5
-# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
-# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
-# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
-#
9
-#                    Freedom in the Cloud
10
-#
11
-
12
-# Removes an xmpp user
13
-
14
-# License
15
-# =======
16
-#
17
-# Copyright (C) 2015-2016 Bob Mottram <bob@freedombone.net>
18
-#
19
-# This program is free software: you can redistribute it and/or modify
20
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
28
-#
29
-# You should have received a copy of the GNU Affero General Public License
30
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
-
32
-PROJECT_NAME='freedombone'
33
-
34
-export TEXTDOMAIN=${PROJECT_NAME}-rmxmpp
35
-export TEXTDOMAINDIR="/usr/share/locale"
36
-
37
-EMAIL_ADDRESS=
38
-
39
-function show_help {
40
-    echo ''
41
-    echo $"${PROJECT_NAME}-rmxmpp -e [email address]"
42
-    echo ''
43
-    exit 0
44
-}
45
-
46
-while [[ $# > 1 ]]
47
-do
48
-key="$1"
49
-
50
-case $key in
51
-    -h|--help)
52
-    show_help
53
-    ;;
54
-    -e|--email)
55
-    shift
56
-    EMAIL_ADDRESS="$1"
57
-    ;;
58
-    *)
59
-    # unknown option
60
-    ;;
61
-esac
62
-shift
63
-done
64
-
65
-if [ ! $EMAIL_ADDRESS ]; then
66
-    show_help
67
-fi
68
-
69
-prosodyctl deluser $EMAIL_ADDRESS
70
-
71
-exit 0