瀏覽代碼

Add users to i2p group when bdsmail is installed

Bob Mottram 7 年之前
父節點
當前提交
799a31ce8f
共有 1 個文件被更改,包括 16 次插入9 次删除
  1. 16
    9
      src/freedombone-app-bdsmail

+ 16
- 9
src/freedombone-app-bdsmail 查看文件

@@ -42,6 +42,10 @@ function bdsmail_configure_users {
42 42
     for d in /home/*/ ; do
43 43
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
44 44
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
45
+
46
+            # Add the user to the i2p group
47
+            usermod -a -G i2psvc $USERNAME
48
+
45 49
             if [ -f /home/$USERNAME/.muttrc ]; then
46 50
                 # Create a mutt i2p folder
47 51
                 if ! grep -q ' =i2p' /home/$USERNAME/.muttrc; then
@@ -199,18 +203,12 @@ function remove_bdsmail {
199 203
         rm /etc/systemd/system/bdsmail.service
200 204
     fi
201 205
 
202
-    remove_i2p
203
-    remove_app bdsmail
204
-    remove_completion_param install_bdsmail
205
-    sed -i '/bdsmail/d' $COMPLETION_FILE
206
-    rm -rf /etc/skel/.mutt
207
-    if [ -d /etc/bdsmail ]; then
208
-        rm -rf /etc/bdsmail
209
-    fi
210
-
211 206
     for d in /home/*/ ; do
212 207
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
213 208
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
209
+            # remove the user from the i2p group
210
+            deluser $USERNAME i2psvc
211
+
214 212
             # Remove mutt folder hook to the i2p config
215 213
             if [ -f /home/$USERNAME/.muttrc ]; then
216 214
                 if grep -q 'folder-hook !i2p' /home/$USERNAME/.muttrc; then
@@ -230,6 +228,15 @@ function remove_bdsmail {
230 228
             # or just be reinstalling the system without losing mail
231 229
         fi
232 230
     done
231
+
232
+    remove_i2p
233
+    remove_app bdsmail
234
+    remove_completion_param install_bdsmail
235
+    sed -i '/bdsmail/d' $COMPLETION_FILE
236
+    rm -rf /etc/skel/.mutt
237
+    if [ -d /etc/bdsmail ]; then
238
+        rm -rf /etc/bdsmail
239
+    fi
233 240
 }
234 241
 
235 242
 function install_bdsmail {