Просмотр исходного кода

Refresh blocklist firewall after restore

Bob Mottram 7 лет назад
Родитель
Сommit
bcc5e80d21
3 измененных файлов: 16 добавлений и 2 удалений
  1. 3
    1
      src/freedombone-restore-local
  2. 3
    1
      src/freedombone-restore-remote
  3. 10
    0
      src/freedombone-utils-firewall

+ 3
- 1
src/freedombone-restore-local Просмотреть файл

13
 # License
13
 # License
14
 # =======
14
 # =======
15
 #
15
 #
16
-# Copyright (C) 2015-2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2015-2017 Bob Mottram <bob@freedombone.net>
17
 #
17
 #
18
 # This program is free software: you can redistribute it and/or modify
18
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
19
 # it under the terms of the GNU Affero General Public License as published by
128
         fi
128
         fi
129
 
129
 
130
         rm -rf $temp_restore_dir
130
         rm -rf $temp_restore_dir
131
+
132
+        firewall_refresh_blocklist
131
     fi
133
     fi
132
 }
134
 }
133
 
135
 

+ 3
- 1
src/freedombone-restore-remote Просмотреть файл

13
 # License
13
 # License
14
 # =======
14
 # =======
15
 #
15
 #
16
-# Copyright (C) 2015-2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2015-2017 Bob Mottram <bob@freedombone.net>
17
 #
17
 #
18
 # This program is free software: you can redistribute it and/or modify
18
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
19
 # it under the terms of the GNU Affero General Public License as published by
120
         fi
120
         fi
121
 
121
 
122
         rm -rf $temp_restore_dir
122
         rm -rf $temp_restore_dir
123
+
124
+        firewall_refresh_blocklist
123
     fi
125
     fi
124
 }
126
 }
125
 
127
 

+ 10
- 0
src/freedombone-utils-firewall Просмотреть файл

491
     fi
491
     fi
492
 }
492
 }
493
 
493
 
494
+function firewall_refresh_blocklist {
495
+    if [ ! -f /root/${PROJECT_NAME}-firewall-domains.cfg ]; then
496
+        return
497
+    fi
498
+
499
+    while read blocked_domain; do
500
+        firewall_block_domain $blocked_domain
501
+    done </root/${PROJECT_NAME}-firewall-domains.cfg
502
+}
503
+
494
 function firewall_unblock_domain {
504
 function firewall_unblock_domain {
495
     unblocked_domain="$1"
505
     unblocked_domain="$1"
496
     if grep "${unblocked_domain}" $FIREWALL_DOMAINS; then
506
     if grep "${unblocked_domain}" $FIREWALL_DOMAINS; then