#!/bin/sh ### # Place the Avahi init script. ### config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/rc.d/rc.avahidaemon.new config etc/rc.d/rc.avahidnsconfd.new config etc/avahi/avahi-daemon.conf.new config etc/dbus-1/system.d/avahi-dbus.conf.new ### # Create avahi user:group if they don't exist. ### group_exists=`grep ^avahi etc/group` if [[ "${group_exists}" == "" ]]; then groupadd avahi fi user_exists=`grep ^avahi etc/passwd` if [[ "${user_exists}" == "" ]]; then useradd -g avahi -d / -c "Avahi" -s /bin/false avahi fi ### # Create avahi-autoipd user:group if they don't exist. ### group_exists=`grep ^avahi-autoipd etc/group` if [[ "${group_exists}" == "" ]]; then groupadd avahi-autoipd fi user_exists=`grep ^avahi-autoipd etc/passwd` if [[ "${user_exists}" == "" ]]; then useradd -g avahi-autoipd -d / -c "Avahi-Autopid" -s /bin/false avahi-autoipd fi ### # Create netdev group if they don't exist. ### group_exists=`grep ^netdev etc/group` if [[ "${group_exists}" == "" ]]; then groupadd netdev fi