Commit 753c5f13 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Toggle avahi daemon with armbian-config https://github.com/armbian/build/issues/1140

parent 10070c55
......@@ -1078,6 +1078,20 @@ function jobs ()
fi
;;
"Avahi")
if ! is_package_manager_running; then
if check_if_installed avahi-daemon ; then
service avahi-daemon stop
debconf-apt-progress -- apt-get -y purge avahi-daemon
else
debconf-apt-progress -- apt-get -y install avahi-daemon
[[ -f /usr/share/doc/avahi-daemon/examples/sftp-ssh.service ]] && cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/
[[ -f /usr/share/doc/avahi-daemon/examples/ssh.service ]] && cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/
service avahi-daemon restart
fi
fi
;;
# Edit boot environment
#
......
......@@ -63,6 +63,13 @@ while true; do
LIST+=( "CPU" "Set CPU speed and governor" )
fi
AVAHIDSTATUS=$(service avahi-daemon status 2> /dev/null | grep -w active | grep -w running)
if [[ -n "$AVAHIDSTATUS" ]]; then
LIST+=( "Avahi" "Disable system announce in the network" )
else
LIST+=( "Avahi" "Announce system in the network" )
fi
[[ -d ${OVERLAYDIR} ]] && \
LIST+=( "Hardware" "Toggle hardware configuration: UART, I2C, etc." )
[[ "$LINUXFAMILY" = cubox && "$BRANCH" = "next" ]] && LIST+=( "DTB" "Switch board .dtb configuration" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment