| 
				
			 | 
			
			
				@@ -1271,6 +1271,39 @@ function set_default_onion_domains { 
			 | 
		
	
		
			
			| 
				1271
			 | 
			
				1271
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				1272
			 | 
			
				1272
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				1273
			 | 
			
				1273
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				1274
			 | 
			
			
				+function add_onion_service { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1275
			 | 
			
			
				+    onion_service_name="$1" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1276
			 | 
			
			
				+    onion_service_port_from=$2 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1277
			 | 
			
			
				+    onion_service_port_to=$3 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1278
			 | 
			
			
				+    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1279
			 | 
			
			
				+        echo $"No Tor installation found. ${onion_service_name} onion site cannot be configured." 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1280
			 | 
			
			
				+        exit 877367 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1281
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1282
			 | 
			
			
				+    if ! grep -q "hidden_service_${onion_service_name}" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1283
			 | 
			
			
				+        echo "HiddenServiceDir /var/lib/tor/hidden_service_${onion_service_name}/" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1284
			 | 
			
			
				+        echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1285
			 | 
			
			
				+        echo $"Added onion site for ${onion_service_name}" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1286
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1287
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1288
			 | 
			
			
				+    systemctl restart tor 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1289
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1290
			 | 
			
			
				+    # wait for the new service to appear 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1291
			 | 
			
			
				+    sleep_ctr=0 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1292
			 | 
			
			
				+    while [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; do 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1293
			 | 
			
			
				+        sleep 1 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1294
			 | 
			
			
				+        sleep_ctr=$((sleep_ctr + 1)) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1295
			 | 
			
			
				+        if [ $sleep_ctr -gt 10 ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1296
			 | 
			
			
				+            break 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1297
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1298
			 | 
			
			
				+    done 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1299
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1300
			 | 
			
			
				+    if [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1301
			 | 
			
			
				+        echo $"${onion_service_name} onion site hostname not found" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1302
			 | 
			
			
				+        exit 76362 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1303
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1304
			 | 
			
			
				+    echo $(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1305
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1306
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				1274
			 | 
			
				1307
			 | 
			
			
				 function create_avahi_onion_domains { 
			 | 
		
	
		
			
			| 
				1275
			 | 
			
				1308
			 | 
			
			
				     if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then 
			 | 
		
	
		
			
			| 
				1276
			 | 
			
				1309
			 | 
			
			
				         return 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -3705,24 +3738,8 @@ function configure_ssh_onion { 
			 | 
		
	
		
			
			| 
				3705
			 | 
			
				3738
			 | 
			
			
				         return 
			 | 
		
	
		
			
			| 
				3706
			 | 
			
				3739
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				3707
			 | 
			
				3740
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				3708
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				3709
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. ssh onion domain cannot be configured.' 
			 | 
		
	
		
			
			| 
				3710
			 | 
			
				
			 | 
			
			
				-        exit 32672 
			 | 
		
	
		
			
			| 
				3711
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				3712
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_ssh" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				3713
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_ssh/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				3714
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort ${SSH_PORT} 127.0.0.1:${SSH_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				3715
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion domain for ssh' 
			 | 
		
	
		
			
			| 
				3716
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3741
			 | 
			
			
				+    SSH_ONION_HOSTNAME=$(add_onion_service ssh ${SSH_PORT} ${SSH_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				3717
			 | 
			
				3742
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				3718
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				3719
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				3720
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				3721
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_ssh/hostname ]; then 
			 | 
		
	
		
			
			| 
				3722
			 | 
			
				
			 | 
			
			
				-        echo $'ssh onion domain hostname not found' 
			 | 
		
	
		
			
			| 
				3723
			 | 
			
				
			 | 
			
			
				-        exit 62983 
			 | 
		
	
		
			
			| 
				3724
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				3725
			 | 
			
				
			 | 
			
			
				-    SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname) 
			 | 
		
	
		
			
			| 
				3726
			 | 
			
				3743
			 | 
			
			
				     if ! grep -q "ssh onion domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				3727
			 | 
			
				3744
			 | 
			
			
				         echo "ssh onion domain:${SSH_ONION_HOSTNAME}" >> $COMPLETION_FILE 
			 | 
		
	
		
			
			| 
				3728
			 | 
			
				3745
			 | 
			
			
				     else 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -4219,24 +4236,8 @@ function configure_email { 
			 | 
		
	
		
			
			| 
				4219
			 | 
			
				4236
			 | 
			
			
				         exit 48 
			 | 
		
	
		
			
			| 
				4220
			 | 
			
				4237
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				4221
			 | 
			
				4238
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				4222
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				4223
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Email onion domain cannot be configured.' 
			 | 
		
	
		
			
			| 
				4224
			 | 
			
				
			 | 
			
			
				-        exit 69356 
			 | 
		
	
		
			
			| 
				4225
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				4226
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_email" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				4227
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				4228
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 25 127.0.0.1:${EMAIL_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				4229
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion domain for email' 
			 | 
		
	
		
			
			| 
				4230
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				4239
			 | 
			
			
				+    EMAIL_ONION_HOSTNAME=$(add_onion_service email 25 ${EMAIL_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				4231
			 | 
			
				4240
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				4232
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				4233
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				4234
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				4235
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_email/hostname ]; then 
			 | 
		
	
		
			
			| 
				4236
			 | 
			
				
			 | 
			
			
				-        echo $'Email onion domain hostname not found' 
			 | 
		
	
		
			
			| 
				4237
			 | 
			
				
			 | 
			
			
				-        exit 73928 
			 | 
		
	
		
			
			| 
				4238
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				4239
			 | 
			
				
			 | 
			
			
				-    EMAIL_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_email/hostname) 
			 | 
		
	
		
			
			| 
				4240
			 | 
			
				4241
			 | 
			
			
				     if [[ $ONION_ONLY != "no" ]]; then 
			 | 
		
	
		
			
			| 
				4241
			 | 
			
				4242
			 | 
			
			
				         set_hostname ${EMAIL_ONION_HOSTNAME} 
			 | 
		
	
		
			
			| 
				4242
			 | 
			
				4243
			 | 
			
			
				         MY_EMAIL_ADDRESS=${MY_USERNAME}@${DEFAULT_DOMAIN_NAME} 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -6340,26 +6341,10 @@ quit" > $INSTALL_DIR/batch.sql 
			 | 
		
	
		
			
			| 
				6340
			 | 
			
				6341
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6341
			 | 
			
				6342
			 | 
			
			
				     nginx_ensite $OWNCLOUD_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				6342
			 | 
			
				6343
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6343
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				6344
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Owncloud onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				6345
			 | 
			
				
			 | 
			
			
				-        exit 877367 
			 | 
		
	
		
			
			| 
				6346
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				6347
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_owncloud" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				6348
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_owncloud/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				6349
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${OWNCLOUD_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				6350
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for Owncloud' 
			 | 
		
	
		
			
			| 
				6351
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6344
			 | 
			
			
				+    OWNCLOUD_ONION_HOSTNAME=$(add_onion_service owncloud 80 ${OWNCLOUD_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				6352
			 | 
			
				6345
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6353
			 | 
			
				6346
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				6354
			 | 
			
				6347
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				6355
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				6356
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				6357
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				6358
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_owncloud/hostname ]; then 
			 | 
		
	
		
			
			| 
				6359
			 | 
			
				
			 | 
			
			
				-        echo $'Owncloud onion site hostname not found' 
			 | 
		
	
		
			
			| 
				6360
			 | 
			
				
			 | 
			
			
				-        exit 76362 
			 | 
		
	
		
			
			| 
				6361
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				6362
			 | 
			
				
			 | 
			
			
				-    OWNCLOUD_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_owncloud/hostname) 
			 | 
		
	
		
			
			| 
				6363
			 | 
			
				6348
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6364
			 | 
			
				6349
			 | 
			
			
				     if ! grep -q "Owncloud onion domain" /home/$MY_USERNAME/README; then 
			 | 
		
	
		
			
			| 
				6365
			 | 
			
				6350
			 | 
			
			
				         echo "Owncloud onion domain: ${OWNCLOUD_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -6669,26 +6654,10 @@ quit" > $INSTALL_DIR/batch.sql 
			 | 
		
	
		
			
			| 
				6669
			 | 
			
				6654
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6670
			 | 
			
				6655
			 | 
			
			
				     nginx_ensite $GIT_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				6671
			 | 
			
				6656
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6672
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				6673
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Gogs onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				6674
			 | 
			
				
			 | 
			
			
				-        exit 83547 
			 | 
		
	
		
			
			| 
				6675
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				6676
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_gogs" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				6677
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_gogs/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				6678
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${GIT_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				6679
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for Gogs' 
			 | 
		
	
		
			
			| 
				6680
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6657
			 | 
			
			
				+    GIT_ONION_HOSTNAME=$(add_onion_service gogs 80 ${GIT_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				6681
			 | 
			
				6658
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6682
			 | 
			
				6659
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				6683
			 | 
			
				6660
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				6684
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				6685
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				6686
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				6687
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_gogs/hostname ]; then 
			 | 
		
	
		
			
			| 
				6688
			 | 
			
				
			 | 
			
			
				-        echo $'Gogs onion site hostname not found' 
			 | 
		
	
		
			
			| 
				6689
			 | 
			
				
			 | 
			
			
				-        exit 53935 
			 | 
		
	
		
			
			| 
				6690
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				6691
			 | 
			
				
			 | 
			
			
				-    GIT_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_gogs/hostname) 
			 | 
		
	
		
			
			| 
				6692
			 | 
			
				6661
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6693
			 | 
			
				6662
			 | 
			
			
				     if ! grep -q "Gogs onion domain" /home/$MY_USERNAME/README; then 
			 | 
		
	
		
			
			| 
				6694
			 | 
			
				6663
			 | 
			
			
				         echo "Gogs onion domain: ${GIT_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -7593,26 +7562,11 @@ function install_wiki { 
			 | 
		
	
		
			
			| 
				7593
			 | 
			
				7562
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7594
			 | 
			
				7563
			 | 
			
			
				     nginx_ensite $WIKI_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				7595
			 | 
			
				7564
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7596
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				7597
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Wiki onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				7598
			 | 
			
				
			 | 
			
			
				-        exit 877367 
			 | 
		
	
		
			
			| 
				7599
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				7600
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_wiki" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				7601
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_wiki/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				7602
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${WIKI_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				7603
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for Wiki' 
			 | 
		
	
		
			
			| 
				7604
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7565
			 | 
			
			
				+    WIKI_ONION_HOSTNAME=$(add_onion_service wiki 80 ${WIKI_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				7605
			 | 
			
				7566
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7606
			 | 
			
				7567
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				7607
			 | 
			
				7568
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				7608
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				7609
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				7610
			 | 
			
				7569
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7611
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_wiki/hostname ]; then 
			 | 
		
	
		
			
			| 
				7612
			 | 
			
				
			 | 
			
			
				-        echo $'Wiki onion site hostname not found' 
			 | 
		
	
		
			
			| 
				7613
			 | 
			
				
			 | 
			
			
				-        exit 52383 
			 | 
		
	
		
			
			| 
				7614
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				7615
			 | 
			
				
			 | 
			
			
				-    WIKI_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_wiki/hostname) 
			 | 
		
	
		
			
			| 
				7616
			 | 
			
				7570
			 | 
			
			
				     echo "Wiki onion domain:${WIKI_ONION_HOSTNAME}" >> $COMPLETION_FILE 
			 | 
		
	
		
			
			| 
				7617
			 | 
			
				7571
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7618
			 | 
			
				7572
			 | 
			
			
				     # update the dynamic DNS 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -8006,26 +7960,10 @@ function install_blog { 
			 | 
		
	
		
			
			| 
				8006
			 | 
			
				7960
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8007
			 | 
			
				7961
			 | 
			
			
				     nginx_ensite $FULLBLOG_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				8008
			 | 
			
				7962
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8009
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				8010
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Blog onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				8011
			 | 
			
				
			 | 
			
			
				-        exit 45926 
			 | 
		
	
		
			
			| 
				8012
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8013
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_blog" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				8014
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_blog/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8015
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${FULLBLOG_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8016
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for blog' 
			 | 
		
	
		
			
			| 
				8017
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7963
			 | 
			
			
				+    FULLBLOG_ONION_HOSTNAME=$(add_onion_service blog 80 ${FULLBLOG_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				8018
			 | 
			
				7964
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8019
			 | 
			
				7965
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				8020
			 | 
			
				7966
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				8021
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				8022
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				8023
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				8024
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_blog/hostname ]; then 
			 | 
		
	
		
			
			| 
				8025
			 | 
			
				
			 | 
			
			
				-        echo $'Blog onion site hostname not found' 
			 | 
		
	
		
			
			| 
				8026
			 | 
			
				
			 | 
			
			
				-        exit 12053 
			 | 
		
	
		
			
			| 
				8027
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8028
			 | 
			
				
			 | 
			
			
				-    FULLBLOG_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_blog/hostname) 
			 | 
		
	
		
			
			| 
				8029
			 | 
			
				7967
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8030
			 | 
			
				7968
			 | 
			
			
				     if ! grep -q "Blog onion domain" /home/$MY_USERNAME/README; then 
			 | 
		
	
		
			
			| 
				8031
			 | 
			
				7969
			 | 
			
			
				         echo "Blog onion domain: ${FULLBLOG_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -8323,26 +8261,10 @@ quit" > $INSTALL_DIR/batch.sql 
			 | 
		
	
		
			
			| 
				8323
			 | 
			
				8261
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				8324
			 | 
			
				8262
			 | 
			
			
				     nginx_ensite $MICROBLOG_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				8325
			 | 
			
				8263
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8326
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				8327
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. GNU Social onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				8328
			 | 
			
				
			 | 
			
			
				-        exit 45927 
			 | 
		
	
		
			
			| 
				8329
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8330
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_microblog" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				8331
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_microblog/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8332
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${MICROBLOG_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8333
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for GNU Social' 
			 | 
		
	
		
			
			| 
				8334
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				8264
			 | 
			
			
				+    MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				8335
			 | 
			
				8265
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8336
			 | 
			
				8266
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				8337
			 | 
			
				8267
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				8338
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				8339
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				8340
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				8341
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_microblog/hostname ]; then 
			 | 
		
	
		
			
			| 
				8342
			 | 
			
				
			 | 
			
			
				-        echo $'GNU Social onion site hostname not found' 
			 | 
		
	
		
			
			| 
				8343
			 | 
			
				
			 | 
			
			
				-        exit 12054 
			 | 
		
	
		
			
			| 
				8344
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8345
			 | 
			
				
			 | 
			
			
				-    MICROBLOG_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_microblog/hostname) 
			 | 
		
	
		
			
			| 
				8346
			 | 
			
				8268
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8347
			 | 
			
				8269
			 | 
			
			
				     if ! grep -q "GNU Social onion domain" /home/$MY_USERNAME/README; then 
			 | 
		
	
		
			
			| 
				8348
			 | 
			
				8270
			 | 
			
			
				         echo "GNU Social onion domain: ${MICROBLOG_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -8759,27 +8681,11 @@ quit" > $INSTALL_DIR/batch.sql 
			 | 
		
	
		
			
			| 
				8759
			 | 
			
				8681
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8760
			 | 
			
				8682
			 | 
			
			
				     nginx_ensite $HUBZILLA_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				8761
			 | 
			
				8683
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8762
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /var/lib/tor ]; then 
			 | 
		
	
		
			
			| 
				8763
			 | 
			
				
			 | 
			
			
				-        echo $'No Tor installation found. Hubzilla onion site cannot be configured.' 
			 | 
		
	
		
			
			| 
				8764
			 | 
			
				
			 | 
			
			
				-        exit 45925 
			 | 
		
	
		
			
			| 
				8765
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8766
			 | 
			
				
			 | 
			
			
				-    if ! grep -q "hidden_service_hubzilla" /etc/tor/torrc; then 
			 | 
		
	
		
			
			| 
				8767
			 | 
			
				
			 | 
			
			
				-        echo 'HiddenServiceDir /var/lib/tor/hidden_service_hubzilla/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8768
			 | 
			
				
			 | 
			
			
				-        echo "HiddenServicePort 80 127.0.0.1:${HUBZILLA_ONION_PORT}" >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				8769
			 | 
			
				
			 | 
			
			
				-        echo $'Added onion site for Hubzilla' 
			 | 
		
	
		
			
			| 
				8770
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				8684
			 | 
			
			
				+    HUBZILLA_ONION_HOSTNAME=$(add_onion_service hubzilla 80 ${HUBZILLA_ONION_PORT}) 
			 | 
		
	
		
			
			| 
				8771
			 | 
			
				8685
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8772
			 | 
			
				8686
			 | 
			
			
				     systemctl restart php5-fpm 
			 | 
		
	
		
			
			| 
				8773
			 | 
			
				8687
			 | 
			
			
				     systemctl restart nginx 
			 | 
		
	
		
			
			| 
				8774
			 | 
			
				8688
			 | 
			
			
				     systemctl restart cron 
			 | 
		
	
		
			
			| 
				8775
			 | 
			
				
			 | 
			
			
				-    systemctl restart tor 
			 | 
		
	
		
			
			| 
				8776
			 | 
			
				
			 | 
			
			
				-    sleep 2 
			 | 
		
	
		
			
			| 
				8777
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				8778
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /var/lib/tor/hidden_service_hubzilla/hostname ]; then 
			 | 
		
	
		
			
			| 
				8779
			 | 
			
				
			 | 
			
			
				-        echo $'Hubzilla onion site hostname not found' 
			 | 
		
	
		
			
			| 
				8780
			 | 
			
				
			 | 
			
			
				-        exit 12052 
			 | 
		
	
		
			
			| 
				8781
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				8782
			 | 
			
				
			 | 
			
			
				-    HUBZILLA_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_hubzilla/hostname) 
			 | 
		
	
		
			
			| 
				8783
			 | 
			
				8689
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				8784
			 | 
			
				8690
			 | 
			
			
				     if ! grep -q "Hubzilla onion domain" /home/$MY_USERNAME/README; then 
			 | 
		
	
		
			
			| 
				8785
			 | 
			
				8691
			 | 
			
			
				         echo "Hubzilla onion domain: ${HUBZILLA_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README 
			 |