mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
util-linux-ng: rework init scripts
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
4964f40861
commit
3e2a789ca2
19
packages/sysutils/util-linux-ng/init.d/09_swapfile → packages/sysutils/util-linux-ng/init.d/32_swapfile
Executable file → Normal file
19
packages/sysutils/util-linux-ng/init.d/09_swapfile → packages/sysutils/util-linux-ng/init.d/32_swapfile
Executable file → Normal file
@ -1,5 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||
# http://www.openelec.tv
|
||||
@ -25,13 +23,12 @@
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
|
||||
. /etc/profile
|
||||
(
|
||||
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
|
||||
SWAP=`blkid -t TYPE="swap" -o device`
|
||||
SWAPFILE="$HOME/.cache/swapfile"
|
||||
|
||||
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 [ "$INSTALLED_MEMORY" -le "500000" ]; then
|
||||
if [ -z "$SWAP" -a ! -f "$SWAPFILE" ]; then
|
||||
progress "creating swapfile"
|
||||
mkdir -p $HOME/.cache
|
||||
@ -50,7 +47,7 @@ if [ "$INSTALLED_MEMORY" -le "500000" ]; then
|
||||
else
|
||||
sysctl -w vm.swappiness=60 2>&1 > /dev/null
|
||||
fi
|
||||
else
|
||||
else
|
||||
sysctl -w vm.swappiness=0 2>&1 > /dev/null
|
||||
fi
|
||||
|
||||
fi
|
||||
)&
|
Loading…
x
Reference in New Issue
Block a user