minidlna-1.1.5.initd 682 B

123456789101112131415161718192021222324252627282930313233
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2016 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. : ${CONFIG:=/etc/minidlna.conf}
  5. : ${M_USER:=minidlna}
  6. : ${M_GROUP:=minidlna}
  7. name="MiniDLNA"
  8. pidfile="/run/minidlna/minidlna.pid"
  9. command="/usr/sbin/minidlnad"
  10. command_args="-P $pidfile -f $CONFIG"
  11. start_stop_daemon_args="--user ${M_USER}:${M_GROUP}"
  12. required_files="$CONFIG"
  13. depend() {
  14. need net
  15. }
  16. start_pre() {
  17. if [ "$M_USER" = "root" ]; then
  18. eerror "It's not a good idea to run minidlna as root!"
  19. fi
  20. if yesno "$RESCAN"; then
  21. command_args="$command_args -R"
  22. fi
  23. checkpath -q -d -m 0750 -o "${M_USER}:${M_GROUP}" "$(dirname "$pidfile")"
  24. }