wok-6.x view compcache/stuff/compcache @ rev 2901
Up: locale-pt_BR (add stuff dir and files under it)
author | Claudinei Pereira <claudinei@slitaz.org> |
---|---|
date | Wed May 06 02:01:42 2009 +0000 (2009-05-06) |
parents | 0c9917d26b5d |
children | 637d4b17803d |
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 compcache compcache_size_kbytes=$SIZE_KB
20 status
21 echo -n "Starting $NAME..."
22 swapon /dev/ramzswap0 -p 100
23 status
24 ;;
25 stop)
26 if [ "$EXIST" = "" ] ; then
27 echo "$NAME is not running."
28 exit 1
29 fi
30 echo -n "Stopping $NAME... "
31 swapoff /dev/ramzswap0
32 status
33 echo -n "Unloding modules"
34 rmmod compcache lzo1x_compress lzo1x_decompress xvmalloc
35 status
36 ;;
37 *)
38 echo ""
39 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
40 echo ""
41 exit 1
42 ;;
43 esac
45 exit 0