Browse Source

aria2: add log

add aria2.log and replace logger -t ARIA2C 'Restarting aria2s service'  with logger -t ARIA2C 'Restarting aria2c service' :D :p

Signed-off-by: Hsing-Wang Liao <kuoruan@gmail.com>
lilik-openwrt-22.03
Hostkit 9 years ago
committed by Hsing-Wang Liao
parent
commit
f96c661e27
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      net/aria2/files/aria2.init

+ 9
- 1
net/aria2/files/aria2.init View File

@ -42,16 +42,24 @@ start_instance() {
config_file="$config_dir/aria2.conf"
session_file="$config_dir/aria2.session"
dht_file="$config_dir/dht.dat"
log_file="$config_dir/aria2.log"
[ -d "$config_dir" ] || {
mkdir -m 0755 -p "$config_dir"
touch "$config_file"
[ -z "$user" ] || chown -R $user $config_dir
}
touch "$session_file"
echo -e "enable-rpc=true\nrpc-allow-origin-all=true\nrpc-listen-all=true\nquiet=true" > $config_file
echo -e "continue=true\ninput-file=$session_file\nsave-session=$session_file" >> $config_file
option_disabled "$s" 'enable_dht' || echo "dht-file-path=$dht_file" >> $config_file
option_disabled "$s" 'enable_log' || {
touch "$log_file"
echo -e "log=$log_file" >> $config_file
}
append_params "$s" \
file_allocation bt_enable_lpd enable_dht rpc_user rpc_passwd rpc_listen_port dir bt_tracker disk_cache \
@ -85,7 +93,7 @@ stop() {
}
restart() {
logger -t ARIA2C 'Restarting aria2s service'
logger -t ARIA2C 'Restarting aria2c service'
stop
sleep 2 # give time to shutdown
start


Loading…
Cancel
Save