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

Include ssh onion address as an email domain

Bob Mottram 8 лет назад
Родитель
Сommit
e080551639
2 измененных файлов: 12 добавлений и 11 удалений
  1. 0
    11
      src/freedombone-base-email
  2. 12
    0
      src/freedombone-utils-onion

+ 0
- 11
src/freedombone-base-email Просмотреть файл

73
 # refresh gpg keys every few hours
73
 # refresh gpg keys every few hours
74
 REFRESH_GPG_KEYS_HOURS=2
74
 REFRESH_GPG_KEYS_HOURS=2
75
 
75
 
76
-function add_email_hostname {
77
-    extra_email_hostname="$1"
78
-    email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
79
-    if [[ "$email_hostnames" != *"$extra_email_hostname"* ]]; then
80
-        sed -i "s|dc_other_hostnames=.*|dc_other_hostnames='$emailhostnames;extra_email_hostname'|g" /etc/exim4/update-exim4.conf.conf
81
-        update-exim4.conf
82
-        dpkg-reconfigure --frontend noninteractive exim4-config
83
-        systemctl restart saslauthd
84
-    fi
85
-}
86
-
87
 function configure_email_onion {
76
 function configure_email_onion {
88
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
77
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
89
         return
78
         return

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

28
 # You should have received a copy of the GNU Affero General Public License
28
 # You should have received a copy of the GNU Affero General Public License
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
+function add_email_hostname {
32
+    extra_email_hostname="$1"
33
+    email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
34
+    if [[ "$email_hostnames" != *"$extra_email_hostname"* ]]; then
35
+        sed -i "s|dc_other_hostnames=.*|dc_other_hostnames='$emailhostnames;extra_email_hostname'|g" /etc/exim4/update-exim4.conf.conf
36
+        update-exim4.conf
37
+        dpkg-reconfigure --frontend noninteractive exim4-config
38
+        systemctl restart saslauthd
39
+    fi
40
+}
41
+
31
 function onion_update {
42
 function onion_update {
32
     # update so that new onion services appear
43
     # update so that new onion services appear
33
     systemctl reload tor
44
     systemctl reload tor
231
     SSH_ONION_HOSTNAME=$(add_onion_service ssh ${SSH_PORT} ${SSH_PORT})
242
     SSH_ONION_HOSTNAME=$(add_onion_service ssh ${SSH_PORT} ${SSH_PORT})
232
 
243
 
233
     set_completion_param "ssh onion domain" "${SSH_ONION_HOSTNAME}"
244
     set_completion_param "ssh onion domain" "${SSH_ONION_HOSTNAME}"
245
+    add_email_hostname "${SSH_ONION_HOSTNAME}"
234
 
246
 
235
     mark_completed $FUNCNAME
247
     mark_completed $FUNCNAME
236
 }
248
 }