summaryrefslogtreecommitdiffstats
path: root/init.d
diff options
context:
space:
mode:
authorncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2007-01-26 16:35:46 +0000
committerncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2007-01-26 16:35:46 +0000
commita0ecc4773e8efc4ece1e47904afe5e5e85540143 (patch)
treead6763ed0737c300e483eb5be466bad08140c993 /init.d
parent64ac6ff9b912769f91b7d6b7c6dd1377514ed5dd (diff)
downloadalpine-baselayout-a0ecc4773e8efc4ece1e47904afe5e5e85540143.tar.bz2
alpine-baselayout-a0ecc4773e8efc4ece1e47904afe5e5e85540143.tar.xz
added init.d/swap
Diffstat (limited to 'init.d')
-rw-r--r--init.d/Makefile1
-rwxr-xr-xinit.d/swap14
2 files changed, 15 insertions, 0 deletions
diff --git a/init.d/Makefile b/init.d/Makefile
index 64ca7f4..48abcd2 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -17,6 +17,7 @@ SCRIPTS = alpinecfg.sh \
rcL \
rcS \
runtimes \
+ swap\
syslog \
tuntap \
udev \
diff --git a/init.d/swap b/init.d/swap
new file mode 100755
index 0000000..ff30719
--- /dev/null
+++ b/init.d/swap
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+
+start() {
+ ebegin "Enabling swap"
+ swapon -a
+ echo -n $( awk '/^SwapTotal/ { print " (" $2 $3 ") " }' /proc/meminfo )
+ eend $?
+}
+
+stop () {
+ ebegin "Disabling swap"
+ swapoff -a
+ eend $?
+}