Browse Source

Merge pull request #7837 from rosysong/file-server

rosy-file-server: add new package
lilik-openwrt-22.03
Rosen Penev 6 years ago
committed by GitHub
parent
commit
1321984c22
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 94 additions and 0 deletions
  1. +52
    -0
      net/rosy-file-server/Makefile
  2. +13
    -0
      net/rosy-file-server/files/rosyfs.config
  3. +29
    -0
      net/rosy-file-server/files/rosyfs.init

+ 52
- 0
net/rosy-file-server/Makefile View File

@ -0,0 +1,52 @@
#
# Copyright (C) 2019 rosysong@rosinson.com
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rosy-file-server
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/rosy-file-server
SUBMENU:=File Transfer
SECTION:=net
CATEGORY:=Network
TITLE:=Rosy File Server over HTTP
PKGARCH:=all
endef
define Package/rosy-file-server/description
This package is a configuration management for luci-app-rosy-file-server.
endef
define Package/rosy-file-server/conffiles
/etc/config/rosy-file-server
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/rosy-file-server/install
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
$(INSTALL_BIN) ./files/rosyfs.init $(1)/etc/init.d/rosyfs
$(INSTALL_CONF) ./files/rosyfs.config $(1)/etc/config/rosyfs
endef
$(eval $(call BuildPackage,rosy-file-server))

+ 13
- 0
net/rosy-file-server/files/rosyfs.config View File

@ -0,0 +1,13 @@
#
# Copyright (C) 2019 rosysong@rosinson.com
#
config rosyfs default
# Web title
option title 'Rosy File Server'
# Path to share
option target '/www'
option disabled '0'

+ 29
- 0
net/rosy-file-server/files/rosyfs.init View File

@ -0,0 +1,29 @@
#!/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
}

Loading…
Cancel
Save