mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
util-linux-ng: quote tests and some more variables
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
e262e43f0f
commit
b22c10e25b
@ -31,8 +31,8 @@ INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
|
||||
SWAP=`blkid -t TYPE="swap" -o device`
|
||||
SWAPFILE="$HOME/.cache/swapfile"
|
||||
|
||||
if [ $INSTALLED_MEMORY -le 500000 ]; then
|
||||
if [ -z "$SWAP" -a ! -f $SWAPFILE ]; then
|
||||
if [ "$INSTALLED_MEMORY" -le "500000" ]; then
|
||||
if [ -z "$SWAP" -a ! -f "$SWAPFILE" ]; then
|
||||
progress "creating swapfile"
|
||||
mkdir -p $HOME/.cache
|
||||
dd if=/dev/zero of=$SWAPFILE bs=1024 count=262144 2>&1 > /dev/null
|
||||
@ -40,12 +40,12 @@ if [ $INSTALLED_MEMORY -le 500000 ]; then
|
||||
fi
|
||||
|
||||
progress "enable swap"
|
||||
[ -z "$SWAP" -a -f $SWAPFILE ] && SWAP=$SWAPFILE
|
||||
[ -z "$SWAP" -a -f "$SWAPFILE" ] && SWAP=$SWAPFILE
|
||||
for i in $SWAP; do
|
||||
swapon -p 10000 $SWAP 2>&1 > /dev/null
|
||||
done
|
||||
|
||||
if [ $INSTALLED_MEMORY -le 260000 ]; then
|
||||
if [ "$INSTALLED_MEMORY" -le "260000" ]; then
|
||||
sysctl -w vm.swappiness=100 2>&1 > /dev/null
|
||||
else
|
||||
sysctl -w vm.swappiness=60 2>&1 > /dev/null
|
||||
|
Loading…
x
Reference in New Issue
Block a user