wok annotate compcache/stuff/compcache @ rev 4976

add/improve TAGS w* receipts
author Rohit Joshi <jozee@slitaz.org>
date Wed Feb 24 12:36:38 2010 +0000 (2010-02-24)
parents 0c9917d26b5d
children 637d4b17803d
rev   line source
pascal@1975 1 #!/bin/sh
pascal@1975 2 # /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz,
pascal@1975 3 # at boot time or with the command line. Daemons options are configured
pascal@1975 4 # with /etc/daemons.conf
pascal@1975 5 #
pascal@1975 6 . /etc/init.d/rc.functions
mimas@2291 7 source /etc/compcache.conf
pascal@1975 8
mimas@2291 9 NAME="compcache"
pascal@1975 10 EXIST=`cat /proc/swaps | grep ramzswap0`
pascal@1975 11
pascal@1975 12 case "$1" in
pascal@1975 13 start)
pascal@1975 14 if [ ! "$EXIST" = "" ] ; then
pascal@1975 15 echo "$NAME already running."
pascal@1975 16 exit 1
pascal@1975 17 fi
pascal@1975 18 echo -n "Loading module"
pascal@1976 19 modprobe compcache compcache_size_kbytes=$SIZE_KB
pascal@1975 20 status
pascal@1975 21 echo -n "Starting $NAME..."
pascal@1975 22 swapon /dev/ramzswap0 -p 100
pascal@1975 23 status
pascal@1975 24 ;;
pascal@1975 25 stop)
pascal@1975 26 if [ "$EXIST" = "" ] ; then
pascal@1975 27 echo "$NAME is not running."
pascal@1975 28 exit 1
pascal@1975 29 fi
pascal@1975 30 echo -n "Stopping $NAME... "
pascal@1975 31 swapoff /dev/ramzswap0
pascal@1975 32 status
pascal@1975 33 echo -n "Unloding modules"
mimas@2291 34 rmmod compcache lzo1x_compress lzo1x_decompress xvmalloc
pascal@1975 35 status
pascal@1975 36 ;;
pascal@1975 37 *)
pascal@1975 38 echo ""
pascal@1975 39 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
pascal@1975 40 echo ""
pascal@1975 41 exit 1
pascal@1975 42 ;;
pascal@1975 43 esac
pascal@1975 44
pascal@1975 45 exit 0