Avahi service description for ipfs
This commit is contained in:
parent
fdd4a59ee1
commit
e3f6d1ed1c
|
@ -78,7 +78,9 @@ TOX_USERS_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-tox-users.html
|
||||||
# whether to enable zeronet
|
# whether to enable zeronet
|
||||||
ENABLE_ZERONET=
|
ENABLE_ZERONET=
|
||||||
|
|
||||||
function create_avahi_service {
|
IPFS_PORT=4001
|
||||||
|
|
||||||
|
function create_avahi_mesh_service {
|
||||||
service_name=$1
|
service_name=$1
|
||||||
service_type=$2
|
service_type=$2
|
||||||
service_protocol=$3
|
service_protocol=$3
|
||||||
|
@ -86,7 +88,7 @@ function create_avahi_service {
|
||||||
service_description="$5"
|
service_description="$5"
|
||||||
|
|
||||||
if [ ! -d /etc/avahi ]; then
|
if [ ! -d /etc/avahi ]; then
|
||||||
echo $'create_avahi_service: avahi was not installed'
|
echo $'create_avahi_mesh_service: avahi was not installed'
|
||||||
exit 52925
|
exit 52925
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -97,9 +99,7 @@ function create_avahi_service {
|
||||||
echo ' <service>' >> /etc/avahi/services/${service_name}.service
|
echo ' <service>' >> /etc/avahi/services/${service_name}.service
|
||||||
echo " <type>_${service_type}._${service_protocol}</type>" >> /etc/avahi/services/${service_name}.service
|
echo " <type>_${service_type}._${service_protocol}</type>" >> /etc/avahi/services/${service_name}.service
|
||||||
echo " <port>${service_port}</port>" >> /etc/avahi/services/${service_name}.service
|
echo " <port>${service_port}</port>" >> /etc/avahi/services/${service_name}.service
|
||||||
if [ "$service_description" ]; then
|
echo " <txt-record>$service_description</txt-record>" >> /etc/avahi/services/${service_name}.service
|
||||||
echo " <txt-record>$service_description</txt-record>" >> /tmp/zeronet-blog.service
|
|
||||||
fi
|
|
||||||
echo ' </service>' >> /etc/avahi/services/${service_name}.service
|
echo ' </service>' >> /etc/avahi/services/${service_name}.service
|
||||||
echo '</service-group>' >> /etc/avahi/services/${service_name}.service
|
echo '</service-group>' >> /etc/avahi/services/${service_name}.service
|
||||||
}
|
}
|
||||||
|
@ -814,9 +814,9 @@ function setup_ipfs {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOX_ID=$(su -c 'toxid' - $MY_USERNAME)
|
TOX_ID=$(su -c 'toxid' - $MY_USERNAME)
|
||||||
create_avahi_service ipfs "ipfs" udp $IPFS_PORT "${IPFS_PEER_ID}:${TOX_ID}"
|
create_avahi_mesh_service "ipfs" "ipfs" "udp" "$IPFS_PORT" "${IPFS_PEER_ID}:${TOX_ID}"
|
||||||
|
|
||||||
echo 'IPFS installed with ID $IPFS_PEER_ID' >> $INSTALL_LOG
|
echo "IPFS installed with ID ${IPFS_PEER_ID}" >> $INSTALL_LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_tahoelafs {
|
function setup_tahoelafs {
|
||||||
|
|
Loading…
Reference in New Issue