Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
3788e55b
Commit
3788e55b
authored
Apr 20, 2017
by
Igor Pečovnik
Committed by
GitHub
Apr 20, 2017
Browse files
Merge pull request #7 from ThomasKaiser/patch-1
Adjust net.core.rmem_max/net.core.wmem_max when seeding Armbian torrents
parents
bc4bafbc
da029d05
Changes
1
Show whitespace changes
Inline
Side-by-side
softy
View file @
3788e55b
...
@@ -346,6 +346,23 @@ EOF
...
@@ -346,6 +346,23 @@ EOF
dialog
--title
"
Seed
Armbian
torrents
"
--backtitle
"$
BACKTITLE
"
--yes-label
"
Yes
"
--no-label
"
Cancel
"
--yesno
"\
nDo
you
want
to
help
\
dialog
--title
"
Seed
Armbian
torrents
"
--backtitle
"$
BACKTITLE
"
--yes-label
"
Yes
"
--no-label
"
Cancel
"
--yesno
"\
nDo
you
want
to
help
\
community
and
seed
armbian
torrent
files
?
It
will
ensure
faster
download
for
everyone.
We
need
around
50
Gb
of
your
space.
"
10
44
community
and
seed
armbian
torrent
files
?
It
will
ensure
faster
download
for
everyone.
We
need
around
50
Gb
of
your
space.
"
10
44
if
[[
$?
=
0
]];
then
if
[[
$?
=
0
]];
then
#
adjust
network
buffers
if
necessary
rmem_recommended=
4194304
wmem_recommended=
1048576
rmem_actual=
$(sysctl
net.core.rmem_max
|
awk
-F
"
"
'{
print
$3}')
if
[
${
rmem_actual
}
-lt
${
rmem_recommended
}
];
then
grep
-q
net.core.rmem_max
/
etc
/
sysctl.conf
&&
\
sed
-i
"
s
/
net.core.rmem_max =
.*/net.core.rmem_max
=
${
rmem_recommended
}/"
/
etc
/
sysctl.conf
||
\
echo
"
net.core.rmem_max =
${rmem_recommended}"
>
> /etc/sysctl.conf
fi
wmem_actual=$(sysctl net.core.wmem_max | awk -F" " '{print $3}')
if [ ${wmem_actual} -lt ${wmem_recommended} ]; then
grep -q net.core.wmem_max /etc/sysctl.conf
&&
\
sed -i "s/net.core.wmem_max =.*/net.core.wmem_max = ${wmem_recommended}/" /etc/sysctl.conf || \
echo "net.core.wmem_max = ${wmem_recommended}" >> /etc/sysctl.conf
fi
/sbin/sysctl -p
# create cron job for daily sync with official Armbian torrents
cat > /etc/cron.daily/seed-armbian-torrent
<
<"
EOF
"
cat > /etc/cron.daily/seed-armbian-torrent
<
<"
EOF
"
#
!/
bin
/
bash
#
!/
bin
/
bash
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment