luci-app-alist: fix data_dir

This commit is contained in:
Bard 2023-06-22 12:59:18 +08:00 committed by sbwml
parent bb93e7212f
commit 8b15448511
2 changed files with 3 additions and 3 deletions

View File

@ -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})

View File

@ -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