wok view compcache/stuff/compcache @ rev 11801

syslinux: fix ifmem.c
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 25 11:52:40 2012 +0100 (2012-02-25)
parents 2fea1271d9d2
children
line source
1 #!/bin/sh
2 # /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 source /etc/compcache.conf
9 NAME="compcache"
10 EXIST=`cat /proc/swaps | grep ramzswap0`
12 case "$1" in
13 start)
14 if [ ! "$EXIST" = "" ] ; then
15 echo "$NAME already running."
16 exit 1
17 fi
18 echo -n "Loading module"
19 modprobe ramzswap disksize_kb=$SIZE_KB
20 status
21 echo -n "Starting $NAME..."
22 rzscontrol /dev/ramzswap0 --init
23 swapon /dev/ramzswap0 -p 100
24 status
25 ;;
26 stop)
27 if [ "$EXIST" = "" ] ; then
28 echo "$NAME is not running."
29 exit 1
30 fi
31 echo -n "Stopping $NAME... "
32 swapoff /dev/ramzswap0
33 rzscontrol /dev/ramzswap0 --reset
34 status
35 echo -n "Unloding modules"
36 rmmod ramzswap
37 status
38 ;;
39 *)
40 echo ""
41 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
42 echo ""
43 exit 1
44 ;;
45 esac
47 exit 0