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

#!/bin/sh /etc/rc.common
#
# Copyright (C) 2019 rosysong@rosinson.com
#
START=99
USE_PROCD=1
SHARE_PATH=/www/rosyfs-share
service_triggers() {
procd_add_reload_trigger rosyfs
}
start_service() {
config_load rosyfs
config_get disabled default disabled '0'
config_get target default target ''
[ $disabled -eq 1 ] && return
[ -n "$target" -a ! "$(readlink $SHARE_PATH)" = "$target" ] && {
rm -f $SHARE_PATH
ln -s $target $SHARE_PATH
}
}
stop_service() {
rm -f $SHARE_PATH
}