瀏覽代碼

Set the email onion domain as hostname on onion only installs

Bob Mottram 7 年之前
父節點
當前提交
0241abd55b
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17
    0
      src/freedombone-utils-final

+ 17
- 0
src/freedombone-utils-final 查看文件

124
     systemctl enable firststart
124
     systemctl enable firststart
125
 }
125
 }
126
 
126
 
127
+function final_set_onion_hostname {
128
+    if [[ "$ONION_ONLY" == 'no' ]]; then
129
+        return
130
+    fi
131
+
132
+    if [ ! -f /var/lib/tor/hidden_service_email/hostname ]; then
133
+        echo $'No onion domain for email was found'
134
+        exit 368365
135
+    fi
136
+    onion_domain=$(cat /var/lib/tor/hidden_service_email/hostname)
137
+    echo "$onion_domain" > /etc/hostname
138
+    hostname "$onion_domain"
139
+}
140
+
127
 function setup_final {
141
 function setup_final {
128
     function_check update_installed_apps_list
142
     function_check update_installed_apps_list
129
     update_installed_apps_list
143
     update_installed_apps_list
131
     function_check create_default_user_removal_daemon
145
     function_check create_default_user_removal_daemon
132
     create_default_user_removal_daemon
146
     create_default_user_removal_daemon
133
 
147
 
148
+    function_check final_set_onion_hostname
149
+    final_set_onion_hostname
150
+
134
     function_check install_tripwire
151
     function_check install_tripwire
135
     install_tripwire
152
     install_tripwire
136
 
153