luci-app-alist: init.d: update for v3.3.0

This commit is contained in:
sbwml 2022-11-02 07:29:06 +08:00
parent bb8eb666b6
commit bbef360f7a
2 changed files with 6 additions and 6 deletions

View File

@ -41,8 +41,8 @@ function clear_log()
end
function admin_info()
local username = luci.sys.exec("/usr/bin/alist --conf /etc/alist/config.json password 2>&1 | tail -2 | awk 'NR==1 {print $2}'")
local password = luci.sys.exec("/usr/bin/alist --conf /etc/alist/config.json password 2>&1 | tail -2 | awk 'NR==2 {print $2}'")
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}'")
luci.http.prepare_content("application/json")
luci.http.write_json({username = username, password = password})

View File

@ -3,7 +3,7 @@
START=99
USE_PROCD=1
PROG=/usr/bin/alist
CONFIG=/etc/alist/config.json
CONFIG_DIR=/etc/alist
get_config() {
config_get_bool enabled $1 enabled 1
@ -61,12 +61,12 @@ start_service() {
fi
set_firewall
cat /dev/null > $temp_dir/alist.log
cat > $CONFIG <<EOF
{"force":false,"address":"$listen_addr","port":$port,"jwt_secret":"","cdn":"","database":{"type":"sqlite3","host":"","port":0,"user":"","password":"","name":"","db_file":"/etc/alist/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"https":$SSL,"cert_file":"$ssl_cert","key_file":"$ssl_key"},"temp_dir":"$temp_dir","log":{"enable":$LOG,"name":"$temp_dir/alist.log","max_size":10,"max_backups":5,"max_age":28,"compress":false}}
cat > $CONFIG_DIR/config.json <<EOF
{"force":false,"address":"$listen_addr","port":$port,"cdn":"","jwt_secret":"","token_expires_in":48,"database":{"type":"sqlite3","host":"","port":0,"user":"","password":"","name":"","db_file":"/etc/alist/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"https":$SSL,"cert_file":"$ssl_cert","key_file":"$ssl_key"},"temp_dir":"$temp_dir","log":{"enable":$LOG,"name":"$temp_dir/alist.log","max_size":10,"max_backups":5,"max_age":28,"compress":false}}
EOF
procd_open_instance alist
procd_set_param command $PROG
procd_append_param command server --conf $CONFIG
procd_append_param command server --data $CONFIG_DIR
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn