diff options
author | zhanghua000 | 2022-10-26 16:23:22 +0800 |
---|---|---|
committer | zhanghua000 | 2022-10-26 16:23:22 +0800 |
commit | 37b232e22f367370d33ea3f7bddb41b6d606a0ef (patch) | |
tree | 25defd8fd1c1fc7362c84cf6a20a401cebeb4590 /notify-user-and-copy-config | |
parent | 58bf3c46184f3d7e3ed506ab91f027ed8f1f14ef (diff) | |
download | aur-37b232e22f367370d33ea3f7bddb41b6d606a0ef.tar.gz |
Rewrite code
Diffstat (limited to 'notify-user-and-copy-config')
-rw-r--r-- | notify-user-and-copy-config | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/notify-user-and-copy-config b/notify-user-and-copy-config new file mode 100644 index 000000000000..b891fbb91ed6 --- /dev/null +++ b/notify-user-and-copy-config @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +echo "aria2cd has been installed/updated successfully, but there is something extra to do." +echo "" +echo "If you are using user service, there are two options:" +echo "" +echo "1. You need to copy /usr/share/aria2/ to \${HOME}/.aria2/, \${HOME} is the home directory of the user who runs aria2c." +echo "2. Copy aria2.conf and tracker-config.sh in /usr/share/aria2 to \${XDG_CONFIG_HOME:-\${HOME}/.config}/aria2/" +echo " Copy aria2.session, dht.dat and dnt6.dat in /usr/share/aria2 to \${XDG_CACHE_HOME:-\${HOME}/.config}/aria2/" +echo "" +echo "The latter(\${XDG_CACHE_HOME}/aria2/ and \${XDG_CONFIG_HOME}/aria2/) is preferered to use because it follows freedesktop's specification." +echo "" +echo "According to systemd document, you also need to enable NetworkManager-wait-online.service or systemd-networkd-wait-online.service if you want to use aria2-update-tracker.timer." +echo "" +echo "Note: aria2@username.service is deprecated now, it may be removed in the future. You can use system wide aria2.service or user wide aria2.service instead." +echo " Files downloaded by system service is placed at /var/lib/aria2cd/Downloads and will be cleaned after 30 days, please copy it to a safe place if needed." +echo "" + +mkdir -p /etc/aria2cd +for file in aria2.conf tracker-config.sh +do + echo "Copying ${file}..." + [[ ! -f /etc/aria2cd/${file} ]] && \ + cp /usr/share/aria2/${file} /etc/aria2cd/${file} +done +echo "Finished copying config." |