Update 2024-12-22 19:37 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2024-12-22 19:37:24 +01:00
parent 7948d7cd1d
commit a145968b49
2 changed files with 39 additions and 28 deletions

View File

@ -3,6 +3,38 @@
DIR="/home/sdk/.aria2"
mkdir -p "$DIR"
SECOPTS="\
--bt-enable-lpd=false
--enable-peer-exchange=false
--enable-dht=false
--enable-dht6=false
"
PUBLIC="\
--dht-listen-port=55500
--bt-enable-lpd=true
--enable-peer-exchange=true
--enable-dht=true
--enable-dht6=true
"
DEFAULT="\
--auto-save-interval=30
--save-session-interval=30
--listen-port=55500
--log-level=info
--disk-cache=256M
--bt-save-metadata=true
--bt-load-saved-metadata=true
--bt-prioritize-piece=head=10M,tail=10M
--content-disposition-default-utf8=true
--log=$DIR/aria2.log
--dht-file-path=$DIR/dht.dat
--dht-file-path6=$DIR/dht6.dat
--save-cookies=$DIR/cookies.dat
--save-session=$DIR/session.dat
"
for cmd in $@
do
case $cmd in
@ -38,6 +70,8 @@ do
--bt-min-crypto-level=arc4
"
shift ;;
pub|public) SECOPTS="$PUBLIC"
shift ;;
seq|1) OPTS="$OPTS
-j 1 -Z
"
@ -45,32 +79,10 @@ do
esac
done
DEFAULT="\
--enable-dht=false
--enable-dht6=false
--bt-force-encryption=true
--enable-peer-exchange=false
--auto-save-interval=30
--save-session-interval=30
--listen-port=55500
--dht-listen-port=55500
--bt-enable-lpd=false
--log-level=info
--disk-cache=256M
--bt-save-metadata=true
--bt-load-saved-metadata=true
--bt-prioritize-piece=head=10M,tail=10M
--content-disposition-default-utf8=true
--log=$DIR/aria2.log
--dht-file-path=$DIR/dht.dat
--dht-file-path6=$DIR/dht6.dat
--save-cookies=$DIR/cookies.dat
--save-session=$DIR/session.dat
"
set -x
if [ -z "$@" ]
then
aria2c $DEFAULT $OPTS *.torrent
aria2c $DEFAULT $OPTS $SECOPTS *.torrent
else
aria2c $DEFAULT $OPTS "$@"
aria2c $DEFAULT $OPTS $SECOPTS "$@"
fi

View File

@ -1,11 +1,10 @@
#!/bin/sh
case $1 in
cp) shift; scp -r $@ osmc:/media/USBDisk/ ;;
cp) shift; rsync -rvP $@ osmc:/media/USBDisk/ ;;
df) ssh osmc "df -h /media/USBDisk/" ;;
ls) ssh osmc "cd /media/USBDisk/ && ls -1 | grep -v lost+found" ;;
lls) ssh osmc "cd /media/USBDisk/ && ls -lh | grep -v lost+found" ;;
rm) shift; ssh osmc "cd /media/USBDisk/ && rm -v $@" ;;
*) echo "available commands: df, ls, lls, cp <file>, rm <file>" ;;
esac