set -e force=$1 function safe_copy () { if [[ "$force" == "True" ]]; then sudo yunohost service safecopy \ -s avahi-daemon $1 $2 --force else sudo yunohost service safecopy \ -s avahi-daemon $1 $2 fi } cd /usr/share/yunohost/templates/avahi-daemon if [[ "$(safe_copy avahi-daemon.conf /etc/avahi/avahi-daemon.conf | tail -n1)" == "True" ]]; then sudo service avahi-daemon restart fi