util-linux-ng: rework init scripts

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-01-09 03:44:55 +01:00
parent 4964f40861
commit 3e2a789ca2

View 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
)&