Browse Source

Add users to i2p group when bdsmail is installed

Bob Mottram 7 years ago
parent
commit
799a31ce8f
1 changed files with 16 additions and 9 deletions
  1. 16
    9
      src/freedombone-app-bdsmail

+ 16
- 9
src/freedombone-app-bdsmail View File

42
     for d in /home/*/ ; do
42
     for d in /home/*/ ; do
43
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
43
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
44
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
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
             if [ -f /home/$USERNAME/.muttrc ]; then
49
             if [ -f /home/$USERNAME/.muttrc ]; then
46
                 # Create a mutt i2p folder
50
                 # Create a mutt i2p folder
47
                 if ! grep -q ' =i2p' /home/$USERNAME/.muttrc; then
51
                 if ! grep -q ' =i2p' /home/$USERNAME/.muttrc; then
199
         rm /etc/systemd/system/bdsmail.service
203
         rm /etc/systemd/system/bdsmail.service
200
     fi
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
     for d in /home/*/ ; do
206
     for d in /home/*/ ; do
212
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
207
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
213
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
208
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
209
+            # remove the user from the i2p group
210
+            deluser $USERNAME i2psvc
211
+
214
             # Remove mutt folder hook to the i2p config
212
             # Remove mutt folder hook to the i2p config
215
             if [ -f /home/$USERNAME/.muttrc ]; then
213
             if [ -f /home/$USERNAME/.muttrc ]; then
216
                 if grep -q 'folder-hook !i2p' /home/$USERNAME/.muttrc; then
214
                 if grep -q 'folder-hook !i2p' /home/$USERNAME/.muttrc; then
230
             # or just be reinstalling the system without losing mail
228
             # or just be reinstalling the system without losing mail
231
         fi
229
         fi
232
     done
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
 function install_bdsmail {
242
 function install_bdsmail {