luci-app-alist: init.d: update for v3.3.0
This commit is contained in:
parent
bb8eb666b6
commit
bbef360f7a
@ -41,8 +41,8 @@ function clear_log()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function admin_info()
|
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 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 --conf /etc/alist/config.json password 2>&1 | tail -2 | awk 'NR==2 {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.prepare_content("application/json")
|
||||||
luci.http.write_json({username = username, password = password})
|
luci.http.write_json({username = username, password = password})
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
START=99
|
START=99
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
PROG=/usr/bin/alist
|
PROG=/usr/bin/alist
|
||||||
CONFIG=/etc/alist/config.json
|
CONFIG_DIR=/etc/alist
|
||||||
|
|
||||||
get_config() {
|
get_config() {
|
||||||
config_get_bool enabled $1 enabled 1
|
config_get_bool enabled $1 enabled 1
|
||||||
@ -61,12 +61,12 @@ start_service() {
|
|||||||
fi
|
fi
|
||||||
set_firewall
|
set_firewall
|
||||||
cat /dev/null > $temp_dir/alist.log
|
cat /dev/null > $temp_dir/alist.log
|
||||||
cat > $CONFIG <<EOF
|
cat > $CONFIG_DIR/config.json <<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}}
|
{"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
|
EOF
|
||||||
procd_open_instance alist
|
procd_open_instance alist
|
||||||
procd_set_param command $PROG
|
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 stdout 1
|
||||||
procd_set_param stderr 1
|
procd_set_param stderr 1
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
|
Loading…
Reference in New Issue
Block a user