diff --git a/luci-app-alist/Makefile b/luci-app-alist/Makefile index 70fc451ba..a7ed66e88 100644 --- a/luci-app-alist/Makefile +++ b/luci-app-alist/Makefile @@ -6,20 +6,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-alist -PKG_VERSION:=1.0.11 +PKG_VERSION:=1.0.12 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for alist LUCI_DEPENDS:=+alist +luci-compat -define Package/$(PKG_NAME)/conffiles -/etc/alist -endef - define Package/$(PKG_NAME)/postinst #!/bin/sh [ -n "${IPKG_INSTROOT}" ] || { - ( . /etc/uci-defaults/luci-alist ) && rm -f /etc/uci-defaults/luci-alist + ( . /etc/uci-defaults/50-luci-alist ) && rm -f /etc/uci-defaults/50-luci-alist exit 0 } endef diff --git a/luci-app-alist/root/etc/alist/data.db b/luci-app-alist/root/etc/alist/data.db deleted file mode 100644 index e1bb40dd3..000000000 Binary files a/luci-app-alist/root/etc/alist/data.db and /dev/null differ diff --git a/luci-app-alist/root/etc/config/alist b/luci-app-alist/root/etc/config/alist deleted file mode 100644 index 75aa0b320..000000000 --- a/luci-app-alist/root/etc/config/alist +++ /dev/null @@ -1,9 +0,0 @@ -config alist - option 'enabled' '0' - option 'port' '5244' - option 'temp_dir' '/tmp/alist' - option 'ssl' '0' - option 'token_expires_in' '48' - option 'max_connections' '0' - option 'site_url' '' - option 'delayed_start' '0' diff --git a/luci-app-alist/root/etc/init.d/alist b/luci-app-alist/root/etc/init.d/alist deleted file mode 100755 index ed0eab238..000000000 --- a/luci-app-alist/root/etc/init.d/alist +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -USE_PROCD=1 -PROG=/usr/bin/alist - -get_config() { - config_get_bool enabled $1 enabled 1 - config_get port $1 port 5244 - config_get log $1 log 1 - config_get site_url $1 site_url "" - config_get data_dir $1 data_dir "/etc/alist" - config_get temp_dir $1 temp_dir "/tmp/alist" - config_get ssl $1 ssl 0 - config_get ssl_cert $1 ssl_cert "" - config_get ssl_key $1 ssl_key "" - config_get token_expires_in $1 token_expires_in 48 - config_get allow_wan $1 allow_wan 0 - config_get max_connections $1 max_connections 0 - config_get delayed_start $1 delayed_start 0 - - # mysql - config_get mysql $1 mysql 0 - config_get mysql_host $1 mysql_host "" - config_get mysql_port $1 mysql_port "3306" - config_get mysql_username $1 mysql_username "" - config_get mysql_password $1 mysql_password "" - config_get mysql_database $1 mysql_database "" - - config_load network - config_get lan_addr lan ipaddr "0.0.0.0" - if echo "${lan_addr}" | grep -Fq ' '; then - lan_addr="0.0.0.0" - else - lan_addr=${lan_addr%%/*} - fi -} - -set_firewall() { - if [ "$external_access" = "allow" ]; then - uci -q delete firewall.alist - uci set firewall.alist=rule - uci set firewall.alist.name="alist" - uci set firewall.alist.target="ACCEPT" - uci set firewall.alist.src="wan" - uci set firewall.alist.proto="tcp" - uci set firewall.alist.dest_port="$port" - uci set firewall.alist.enabled="1" - uci commit firewall - /etc/init.d/firewall reload >/dev/null 2>&1 - elif [ "$external_access" = "deny" ]; then - uci -q delete firewall.alist - uci commit firewall - /etc/init.d/firewall reload >/dev/null 2>&1 - fi -} - -start_service() { - config_load alist - config_foreach get_config alist - [ $enabled -ne 1 ] && return 1 - mkdir -p $temp_dir $data_dir - [ "$ssl" -eq 1 ] && https_port=$port http_port="-1" || https_port="-1" http_port=$port - [ "$log" -eq 1 ] && log=true || log=false - if [ -e /proc/uptime ]; then - [ $(awk -F. '{print $1}' /proc/uptime) -lt "120" ] && delayed_start=$delayed_start || delayed_start=0 - else - delayed_start=$delayed_start - fi - if [ "$allow_wan" -eq "1" ]; then - listen_addr="0.0.0.0" - external_access="allow" - else - listen_addr=$lan_addr - external_access="deny" - fi - # mysql - [ "$mysql" -eq 1 ] && database=mysql || database=sqlite3 - set_firewall - true > $temp_dir/alist.log - cat > $data_dir/config.json <