#!/bin/sh DAEMON=netatalk DAEMON_LONG_NAME=Netatalk . /etc/init.d/modlibrc do_afpd() { /mod/etc/init.d/rc.netatalk.afpd $1 } do_cnid_metad() { /mod/etc/init.d/rc.netatalk.cnid_metad $1 } config() { mkdir -p /mod/etc/netatalk /mod/etc/default.netatalk/afpd_conf_conf > /mod/etc/netatalk/afpd.conf /mod/etc/default.netatalk/applevolumes_default_conf > /mod/etc/netatalk/AppleVolumes.default } case $1 in ""|load) mkdir -p /mod/etc/netatalk mkdir -p /tmp/flash/netatalk mkdir -p /var/run modlib_addgroup users modlib_adduser ftpuser -G users -D -S -h "/var/media/ftp" -g "ftpuser" modreg cgi netatalk "Netatalk" modreg file netatalk applevolumes_default '$(lang de:"Freigaben" en:"Shares")' 1 "applevolumes_default" modreg file netatalk afpd_conf '$(lang de:"Virtuelle Datei-Server" en:"Virtual Fileservers")' 1 "afpd_conf" modreg daemon netatalk config do_cnid_metad $1 do_afpd $1 ;; unload) modunreg daemon $DAEMON modunreg file netatalk modunreg cgi netatalk do_afpd unload do_cnid_metad unload ;; start) config do_cnid_metad start do_afpd start ;; stop) do_afpd stop do_cnid_metad stop ;; restart) do_afpd stop do_cnid_metad stop config do_cnid_metad start do_afpd start ;; reload) config do_cnid_metad reload do_afpd reload ;; status) do_afpd status ;; config) config ;; *) echo "Usage: $0 [load|unload|start|stop|restart|reload|status|config]" 1>&2 exit 1 ;; esac exit 0