diff --git a/luci-app-alist/luasrc/controller/alist.lua b/luci-app-alist/luasrc/controller/alist.lua index 4f192ec..063aa37 100644 --- a/luci-app-alist/luasrc/controller/alist.lua +++ b/luci-app-alist/luasrc/controller/alist.lua @@ -41,8 +41,8 @@ function clear_log() end function admin_info() - local username = luci.sys.exec("/usr/bin/alist --data /etc/alist password 2>&1 | tail -2 | awk 'NR==1 {print $2}'") - local password = luci.sys.exec("/usr/bin/alist --data /etc/alist password 2>&1 | tail -2 | awk 'NR==2 {print $2}'") + local username = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) password 2>&1 | tail -2 | awk 'NR==1 {print $2}'") + local password = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) password 2>&1 | tail -2 | awk 'NR==2 {print $2}'") luci.http.prepare_content("application/json") luci.http.write_json({username = username, password = password}) diff --git a/luci-app-alist/root/etc/init.d/alist b/luci-app-alist/root/etc/init.d/alist index fa5d36a..c6de70f 100755 --- a/luci-app-alist/root/etc/init.d/alist +++ b/luci-app-alist/root/etc/init.d/alist @@ -59,7 +59,7 @@ start_service() { config_load alist config_foreach get_config alist [ $enabled != 1 ] && return 1 - mkdir -p $temp_dir + mkdir -p $temp_dir $data_dir [ "$ssl" -eq 1 ] && SSL=true || SSL=false [ "$log" -eq 1 ] && LOG=true || LOG=false if [ -e /proc/uptime ]; then