Skip to content

Instantly share code, notes, and snippets.

@wjn
Created August 29, 2012 01:24
Show Gist options
  • Save wjn/3505875 to your computer and use it in GitHub Desktop.
Save wjn/3505875 to your computer and use it in GitHub Desktop.
/ffp/start/avahi.sh
#!/ffp/bin/sh
# PROVIDE: avahi
# REQUIRE: SERVERS
. /ffp/etc/ffp.subr
name="avahi"
command="/ffp/sbin/avahi-daemon"
avahi_daemon_flags="-D -s"
required_files="/ffp/etc/avahi/avahi-daemon.conf /ffp/etc/avahi/hosts"
start_cmd="avahi_start"
avahi_start()
{
# need avahi user and group for priviledge separation
if ! grep '^avahi:' /etc/passwd >/dev/null; then
echo 'avahi:x:50:50:Avahi Daemon:/no/where:/bin/false' >>/etc/passwd
fi
if ! grep '^avahi:' /etc/shadow >/dev/null; then
echo 'avahi:*:14493:0:99999:7:::' >>/etc/shadow
fi
if ! grep '^avahi:' /etc/group >/dev/null; then
echo 'avahi::50:avahi' >>/etc/group
fi
proc_start $command
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment