wok-next view linux/stuff/compcache @ rev 20358
Update libunwind, strace; pcmanfm-qt: update dependencies; shrink icu (less 2MB comparing to the *-full version); add awf.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Nov 22 21:52:02 2017 +0200 (2017-11-22) |
parents | 7f188676b59c |
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 DESC="$(_ '%s daemon' compcache)"
11 EXIST=$(cat /proc/swaps | grep zram0)
13 case "$1" in
14 start)
15 if [ -n "$EXIST" ] ; then
16 _ '%s is already running.' $NAME
17 exit 1
18 fi
19 action 'Loading module...'
20 modprobe zram zram_num_devices=1 &&
21 [ -n "$SIZE_KB" ] && echo $(($SIZE_KB * 1024)) > /sys/block/zram0/disksize
22 status
24 action 'Starting %s: %s...' "$DESC" $NAME
25 mkswap /dev/zram0 && swapon /dev/zram0 -p 100
26 status
27 ;;
28 stop)
29 if [ -z "$EXIST" ] ; then
30 _ '%s is not running.' $NAME
31 exit 1
32 fi
33 action 'Stopping %s: %s...' "$DESC" $NAME
34 swapoff /dev/zram0 && echo 1 > /sys/block/zram0/reset
35 status
36 action 'Unloading module...'
37 rmmod zram
38 status
39 ;;
40 *)
41 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop]"
42 newline
43 exit 1
44 ;;
45 esac
47 exit 0