You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
489 B

  1. #!/bin/sh /etc/rc.common
  2. #
  3. # Copyright (C) 2019 rosysong@rosinson.com
  4. #
  5. START=99
  6. USE_PROCD=1
  7. SHARE_PATH=/www/rosyfs-share
  8. service_triggers() {
  9. procd_add_reload_trigger rosyfs
  10. }
  11. start_service() {
  12. config_load rosyfs
  13. config_get disabled default disabled '0'
  14. config_get target default target ''
  15. [ $disabled -eq 1 ] && return
  16. [ -n "$target" -a ! "$(readlink $SHARE_PATH)" = "$target" ] && {
  17. rm -f $SHARE_PATH
  18. ln -s $target $SHARE_PATH
  19. }
  20. }
  21. stop_service() {
  22. rm -f $SHARE_PATH
  23. }