Set the email onion domain as hostname on onion only installs

This commit is contained in:
Bob Mottram 2018-04-04 18:47:47 +01:00
parent 0f882192b4
commit 0241abd55b
1 changed files with 17 additions and 0 deletions

View File

@ -124,6 +124,20 @@ function create_default_user_removal_daemon {
systemctl enable firststart
}
function final_set_onion_hostname {
if [[ "$ONION_ONLY" == 'no' ]]; then
return
fi
if [ ! -f /var/lib/tor/hidden_service_email/hostname ]; then
echo $'No onion domain for email was found'
exit 368365
fi
onion_domain=$(cat /var/lib/tor/hidden_service_email/hostname)
echo "$onion_domain" > /etc/hostname
hostname "$onion_domain"
}
function setup_final {
function_check update_installed_apps_list
update_installed_apps_list
@ -131,6 +145,9 @@ function setup_final {
function_check create_default_user_removal_daemon
create_default_user_removal_daemon
function_check final_set_onion_hostname
final_set_onion_hostname
function_check install_tripwire
install_tripwire