|
@@ -1722,7 +1722,7 @@ function install_zeronet_blog {
|
1722
|
1722
|
echo " <txt-record>$ZERONET_URL/$ZERONET_BLOG_ADDRESS</txt-record>" >> /tmp/zeronet-blog.service
|
1723
|
1723
|
echo ' </service>' >> /tmp/zeronet-blog.service
|
1724
|
1724
|
echo '</service-group>' >> /tmp/zeronet-blog.service
|
1725
|
|
- sudo cp /tmp/zeronet-blog.service /etc/avahi/services/zeronet-blog.service
|
|
1725
|
+ cp /tmp/zeronet-blog.service /etc/avahi/services/zeronet-blog.service
|
1726
|
1726
|
|
1727
|
1727
|
if [ ! -d /home/$MY_USERNAME/.config/zeronet ]; then
|
1728
|
1728
|
mkdir -p /home/$MY_USERNAME/.config/zeronet
|
|
@@ -10416,6 +10416,32 @@ function install_ipfs {
|
10416
|
10416
|
systemctl daemon-reload
|
10417
|
10417
|
systemctl restart ipfs
|
10418
|
10418
|
|
|
10419
|
+ if [ -d /etc/avahi ]; then
|
|
10420
|
+ su -c "echo $($IPFS_PATH/ipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}') > /tmp/ipfsid" - $MY_USERNAME
|
|
10421
|
+ if [ ! -f /tmp/ipfsid ]; then
|
|
10422
|
+ echo 'No IPFS identity was created'
|
|
10423
|
+ exit 37895
|
|
10424
|
+ fi
|
|
10425
|
+ IPFS_PEER_ID=$(cat /tmp/ipfsid)
|
|
10426
|
+ if [ ${#IPFS_PEER_ID} -lt 10 ]; then
|
|
10427
|
+ echo 'Invalid IPFS peer ID'
|
|
10428
|
+ echo "$IPFS_PEER_ID"
|
|
10429
|
+ exit 74782
|
|
10430
|
+ fi
|
|
10431
|
+ # Add an avahi service
|
|
10432
|
+ echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/ipfs.service
|
|
10433
|
+ echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/ipfs.service
|
|
10434
|
+ echo '<service-group>' >> /etc/avahi/services/ipfs.service
|
|
10435
|
+ echo ' <name replace-wildcards="yes">%h IPFS</name>' >> /etc/avahi/services/ipfs.service
|
|
10436
|
+ echo ' <service>' >> /etc/avahi/services/ipfs.service
|
|
10437
|
+ echo ' <type>_ipfs._tcp</type>' >> /etc/avahi/services/ipfs.service
|
|
10438
|
+ echo " <port>$IPFS_PORT</port>" >> /etc/avahi/services/ipfs.service
|
|
10439
|
+ echo " <txt-record>$IPFS_PEER_ID</txt-record>" >> /etc/avahi/services/ipfs.service
|
|
10440
|
+ echo ' </service>' >> /etc/avahi/services/ipfs.service
|
|
10441
|
+ echo '</service-group>' >> /etc/avahi/services/ipfs.service
|
|
10442
|
+ rm /tmp/ipfsid
|
|
10443
|
+ fi
|
|
10444
|
+
|
10419
|
10445
|
echo 'install_ipfs' >> $COMPLETION_FILE
|
10420
|
10446
|
}
|
10421
|
10447
|
|