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>
This commit is contained in:
parent
4b28f01597
commit
f96c661e27
1 changed files with 9 additions and 1 deletions
|
@ -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…
Reference in a new issue