Browse Source

Set the email onion domain as hostname on onion only installs

Bob Mottram 7 years ago
parent
commit
0241abd55b
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      src/freedombone-utils-final

+ 17
- 0
src/freedombone-utils-final View File

@@ -124,6 +124,20 @@ function create_default_user_removal_daemon {
124 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 141
 function setup_final {
128 142
     function_check update_installed_apps_list
129 143
     update_installed_apps_list
@@ -131,6 +145,9 @@ function setup_final {
131 145
     function_check create_default_user_removal_daemon
132 146
     create_default_user_removal_daemon
133 147
 
148
+    function_check final_set_onion_hostname
149
+    final_set_onion_hostname
150
+
134 151
     function_check install_tripwire
135 152
     install_tripwire
136 153